MobienceSDK is a tool for gathering users phone data and events tracking.
yarn add react-native-mobience
or
npm install react-native-mobience --save
Starting from React Native 0.60, autolinking makes the installation process simpler
Mostly automatic installation:
react-native link react-native-mobience
Manual installation:
Manually link the library on Android
- Add to:
android/settings.gradle
include ':react-native-mobience'
project(':react-native-mobience').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mobience/android')
- Add to:
android/app/build.gradle
dependencies {
implementation project(':react-native-mobience')
}
- Add the MobiencePackage class to your list of exported packages into:
android/app/src/main/.../MainApplication.java
...
import pl.spicymobile.reactmobience.MobiencePackage;
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new MobiencePackage()
);
}
if (Platform.OS === 'android') {
Mobience.init("V0K6jhiIfem6CRWHYZ59Nmj3oFBBKbJsnSsWfR2JNq7ktblOUXwbJoBQTpWnw2uSwW76gpiu2kun50jweTY69B",
{},
(initSuccess) => {
console.log(initSuccess)
},
(initError) => {
console.log(initError)
})
}
Mobience.startSDK((result) => {
console.log(result)
}, (errorResult) => {
console.log(errorResult)
})