$ npm install react-native-mapp-plugin --save
For the old version of RN,
$ react-native link react-native-mapp-plugin
- Install pods
cd ios && pod install
- Add the following capabilities for your application target:
- Push Notification
- Background Modes > Remote Notifications
- Background Modes > Location updates
- Create a plist
AppoxeeConfig.plist
and include it in your application’s target:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>inapp</key>
<dict>
<key>custom_fields</key>
<array>
<string>customString</string>
<string>customNumber</string>
<string>customDate</string>
</array>
<key>media_timeout</key>
<integer>5</integer>
</dict>
<key>sdk</key>
<dict>
<key>app_id</key>
<string>your app id</string>
<key>dmc_system_id</key>
<integer>your dmc id</integer>
<key>sdk_key</key>
<string>your sdk key</string>
<key>is_eu</key>
<true/>
<key>open_landing_page_inside_app</key>
<false/>
<key>jamie_url</key>
<string>your inapp server url</string>
<key>apx_open_url_internal</key>
<string>YES</string>
</dict>
</dict>
</plist>
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNMappPluginPackage;
to the imports at the top of the file - Add
new RNMappPluginPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-mapp-plugin' project(':react-native-mapp-plugin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mapp-plugin/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-mapp-plugin')
import Mapp from 'react-native-mapp-plugin';
// TODO: What to do with the module?
Mapp;