$ npm install react-native-mapp-plugin --save
For the old version of RN,
$ react-native link react-native-mapp-plugin
1) Install pods
cd ios && pod install
2) Add the following capabilities for your application target:
3) 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>
android/app/src/main/java/[...]/MainActivity.java
import com.reactlibrary.RNMappPluginPackage;
to the imports at the top of the filenew RNMappPluginPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-mapp-plugin'
project(':react-native-mapp-plugin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mapp-plugin/android')
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;