Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mapp-digital/mapp-engage-reactnative-plugin


https://github.com/mapp-digital/mapp-engage-reactnative-plugin

Last synced: 6 days ago
JSON representation

Awesome Lists containing this project

README

        

# react-native-mapp-plugin

## Getting started
[Site](https://mapp.com/) |
[Docs](https://mapp-wiki.atlassian.net/wiki/spaces/MIC/pages/1154875400/React+Native+Integration+for+Mapp+Cloud)
|[TestApk](https://github.com/MappCloud/React-Native-Test-Application/)

### Installation from npm:

`$ npm install react-native-mapp-plugin --save`

### Mostly automatic installation

For the old version of RN,
`$ react-native link react-native-mapp-plugin`

### Manual installation

#### iOS

1) Install pods
```
cd ios && pod install
```

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

inapp

custom_fields

customString
customNumber
customDate

media_timeout
5

sdk

app_id
your app id
dmc_system_id
your dmc id
sdk_key
your sdk key
is_eu

open_landing_page_inside_app

jamie_url
your inapp server url
apx_open_url_internal
YES

```

#### Android

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')
```

## Usage
```javascript
import Mapp from 'react-native-mapp-plugin';

// TODO: What to do with the module?
Mapp;
```