Compatibility

Each version of the Contentsquare bridge will be linked to specific, fixed versions of each native SDK. In order to make that clear, here is a compatibility table to consider when choosing your version of the bridge. Refer to the React Native Bridge Changelog to know what the changes are for each version.

Bridge VersioniOS SDK VersionAndroid SDK VersionMin React Native VersionMax React Native Version
4.12.04.39.04.35.00.70.0***0.76.x
4.11.24.38.34.34.00.70.0***0.76.x
4.11.14.38.14.34.00.70.0***0.76.x
4.11.04.38.14.34.00.70.0***0.76.x
4.10.14.37.14.33.10.70.0***0.75.x
4.10.04.37.14.33.00.70.0***0.75.x
4.9.04.36.04.32.10.70.0***0.75.x
4.8.04.35.14.31.00.70.0***0.75.x
4.7.04.34.04.30.00.70.0***0.74.x
4.6.14.33.14.29.10.70.0***0.74.x
4.6.04.33.14.29.10.70.0***0.74.x
4.5.14.32.04.27.10.70.0***0.74.x
4.5.04.32.04.27.00.70.0***0.74.x
4.4.04.31.24.27.00.70.0***0.73.x
4.3.14.30.24.26.00.65.0**0.73.x
4.2.04.29.14.24.00.65.0**0.73.x
4.0.14.27.04.23.10.65.0**0.73.x
3.9.04.27.04.23.10.65.0**0.72.x
3.8.04.25.24.20.00.65.0**0.72.x
3.6.14.24.04.20.00.65.0**0.72.x
3.5.04.23.04.19.00.65.0**0.71.x
3.4.04.22.14.18.10.59.0*0.71.x
3.3.14.20.04.15.00.59.0*0.71.x
3.2.04.20.04.15.00.59.00.71.x
3.1.04.18.04.15.00.59.00.70.x
3.0.04.17.04.14.00.59.00.70.x

*make sure to add this configuration if your RN version is below 0.70.0

**make sure to add this configuration to the Android app if your RN version is between 0.69.0 and 0.70.0, and this configuration to the Android app if your RN version is between 0.65.0 and 0.68.0.

***we support all React Native versions that are currently maintained and listed on the official React Native documentation.

Important note about React Native apps with native code

Section titled Important note about React Native apps with native code

Depending on if you created your app as a React Native first app, or if you gradually added some React Native code to your Native first app, you might be using some non JavaScript elements in your app, as well as a mix of native screens and JavaScript screens. If that is the case, it is your responsibility to track all of the screens, either by calling our native SDKs directly in the first case, or the bridge in the second. The same remark applies for other functionalities of the SDK - for example, you might need to send a Transaction Event via the native SDK or via the bridge, depending on the technology used to create your buying page.

Have a look at the Android and iOS SDKs to find out how to call them in native parts of your app.

Also, note that we specifically cover the use of the JavaScript bridge in this documentation. You should never call the Bridge’s NativeModule directly yourself. If for any reason you do so, know that we cannot certify that your implementation will work as expected. Only call our SDKs through the JavaScript Contentsquare module we provide in you JavaScript code (as explained in this document), or directly in your native code.

Note about using Contentsquare along with Expo

Section titled Note about using Contentsquare along with Expo

To use the SDK on an Expo app, you need to have an Expo project with EAS (Expo Application Services). The SDK compatibility with Expo projects requires the extra steps described below.

Add the plugin and your Contentsquare bundle identifier to your app configuration file:

app.json
{
"expo": {
...,
"ios": {
"bundleIdentifier": "com.cs.expo.app", // replace with your bundle id
...
},
"android": {
"package": "com.cs.expo.app", // replace with your bundle id
...
},
"plugins": [
"@contentsquare/react-native-bridge",
],
}

To run your Expo app with the Contentsquare SDK, you can’t use Expo Go since it needs native files and features. To run your app, use expo run:ios or expo run:android.

Or, you can replace the scripts to your app in your project’s package.json:

package.json
"scripts": {
...
"android": "expo run:android",
"ios": "expo run:ios",
},

Known limitations and recommendations

Section titled Known limitations and recommendations

For React Native project below 0.70.0

Section titled For React Native project below 0.70.0

For React Native project between 0.69 - 0.70

Section titled For React Native project between 0.69 - 0.70

For React Native project between 0.65 - 0.68

Section titled For React Native project between 0.65 - 0.68

If you are using PanResponders in your app, a bug might appear on the element implementing it where it will only move for about a second and then freeze. This bug is caused by a conflict between the React Native SDK and our Bridge related to tracking swipe events. May you encounter this bug, the current workaround is to stop the Contentsquare tracking when the pan gesture starts, and resume it as the gesture ends, as follows:

const panResponder = useRef(
PanResponder.create({
[...]
onPanResponderGrant: (evt, gestureState) => {
Contentsquare.stopTracking();
[...]
},
onPanResponderRelease: (evt, gestureState) => {
Contentsquare.resumeTracking();
[...]
},
[...]
})
).current;

Note that, although this workaround fixes the bug, applying it means that swipes on view using the PanResponder won’t be tracked by Contentsquare.