React Native Auto Integration

How to add the Sailthru Mobile React Native SDK using auto integration


From v9.0.0 of the SDK, we have added for support for auto integration. If you are using an older version or want to make manual changes to the integration, see our legacy integration doc here.

Add the SDK

First add the SDK to your project:

npm
npm i react-native-sailthru-mobile
yarn
yarn add react-native-sailthru-mobile

iOS

Navigate to the folder of the app and run cocopods install to link the iOS dependencies:

cd ios; pod install; cd ..

Android

Open the app level build.gradle and add the Sailthru Mobile maven repo:

repositories {
    maven {
        url "https://github.com/carnivalmobile/maven-repository/raw/master/"
    }
}

This allows the React Native SDK to pull in the native Android SDK dependency.

For more details about auto linking, see the React Native auto linking description here

Start the SDK

You will now need to add the startEngine call using the native SDKs. This should be done as early as possible in your app startup in order to ensure the SDK is properly integrated with the app.

iOS

See the iOS integration guide here for details.

Android

See the Android integration guide here for details

Contact us

Top