Currently the minimal supported React Native version is 0.60+ on iOS 10+ and Android Jelly Bean (API 18).
In the version
1.0.0
we have added TypeScript typings and an example app.
Managed Expo apps
can't be supported due to the explicit technical restrictions imposed by Expo. For details, see Expo Documentation, the FAQ "How do I add custom native code to my Expo project?" Smartlook functionality must be implemented in the native code.
Installation
- Install the Smartlook RN bridge
npm install smartlook-react-native-wrapper --save
yarn add smartlook-react-native-wrapper
- Add dependency on native Smartlook SDK
Android
- Open
android/build.gradle
. - Update gradle version to
classpath 'com.android.tools.build:gradle:3.1.0'
in case you are using an older React native version. - Add our maven repository:
allprojects {
repositories {
maven {
url "https://sdk.smartlook.com/android/release"
}
}
}
Also edit gradle-wrapper.properties
so you are using: gradle-6.9-all.zip
. This step is not needed in newer React native versions.
iOS
Smartlook native library is installed as a Cocoapods dependency. There are no manual steps required, just make sure your Cocoapod dependencies are up-to-date after Smartlook RN installation dependency.
Setup and Start Recording
To setup and start recording with Smartlook, Smartlook must be imported and configured:
API Key
To setup Smartlook, the unique project API Key is needed. It can be found in the mobile project settings in the Smartlook Dashboard.
import Smartlook from 'smartlook-react-native-wrapper';
Smartlook.setupAndStartRecording("KEY");
Smartlook now starts recording the app. The recordings will appear in the Smartlook player shortly.
Recording when on mobile network
SDK will upload sessions only on WiFi. When uploading on mobile connections is requested, too, it must be enabled in the project settings in the dashboard. More details about the recording process can be found in the Conceptual documentation
SDK integration example app
Clone the bridge repo:
git clone https://github.com/smartlook/smartlook-react-native-bridge.git
Install the dependencies:
cd smartlook-react-native-bridge && yarn bootstrap
To run it on iOS use:
yarn example iOS
To run it on Android use:
yarn example android