React Native Integration for Mapp Cloud
AcknowledgmentsÂ
iOS: Mapp plugin n support iOS10 and above
Android: Mapp plugin support for Android 21 (Lollipop) and above
Prerequisites
Required React and ReactNative versions
"react": "18.2.0"
"react-native": "0.73.4"
InstallationÂ
Use commandÂ
npm install https://github.com/MappCloud/React-native-plugin.git --save
or
npm install react-native-mapp-plugin --save
Â
Integration
Download plugin locally.
Add it as dependency to your package.json
yarn install or npm
Android Manually integration for the old versions
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 the `getPackages()` method
2. 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')
 3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
    compile project(':react-native-mapp-plugin')
Â
Android Setup:
Setup Firebase on Firebase message console Step A: Enable Firebase Cloud Messaging for Mapp Cloud
Add a plugin in build.Gradle
apply plugin: 'com.google.gms.google-services'
if use Geo add permissions in manifests(Optional only for geolocation)
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /
Â
iOS
1) Install pods
cd ios && pod install
this should install automatically pod
2) Add the following capabilities for your application target:
- Push Notification
- Background Modes > Remote Notifications
- Background Modes > Location updates
Â
3) Create a plist `AppoxeeConfig.plist` and include it in your application’s target:
Â
4) If using Rich notifications follow instructions from:
Rich Push Notifications Integration for iOS
5)In order to execute action from buttons or message body the following code needs to be added at AppDelegate file:
Â