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

  • Node and Yarn installed on your mac.

  • CocoaPods (needed for iOS)

  • Mapp React Native plugin:

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

  1. 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:

<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: