Disabling Automatic SDK Initialization

If you prefer to control when the SDK starts, you can disable the autostart feature and programmatically start the SDK when needed.

You need to edit the Info.plist, usually located in ios/{project_name}/, add the following key:

Info.plist
<dict>
...
<key>CSDisableAutostart</key>
<true/>
...
</dict>

Disabling autostart on Android

Section titled Disabling autostart on Android

You need to edit the AndroidManifest.xml, usually located in android/app/src/main/, add the following flag:

AndroidManifest.xml
<application>
...
<meta-data
android:name="com.contentsquare.android.autostart"
android:value="false"
/>
...
</application>

Programmatically start the SDK

Section titled Programmatically start the SDK

Then, you can start the Contentsquare SDK by calling the start() method of the Contentsquare class. This function should be called as early as possible in the app process. Call this function in the useEffect of your App element:

const App = (): JSX.Element => {
...
useEffect(() => {
Contentsquare.start()
...
});
...
}