Add notification action plugins to a React Native project
The Campaign library supports several notification action plugins. The primary plugins are active by default. You can enable additional ones during the library integration or any time later.
Prerequisites
To use the plugins, you must integrate the Campaign SDK into your app.
Installation
Two implementation options are available for React Native projects.
Option A: using a configuration file
- In the root directory of your project, open the CampaignConfig.json file. Here is an example from our sample app.
- In the
plugins
section, enable the plugins you need.
{
"plugins": {
"Required Mobile-Push plugins": "<true/false>, enable or disable plugin",
"react-native-acoustic-mobile-push": true,
"react-native-acoustic-mobile-push-ios-notification-service": true,
"react-native-acoustic-mobile-push-inapp": true,
"react-native-acoustic-mobile-push-inbox": true,
"Optional Mobile-Push plugins": "<true/false>, enable or disable plugin",
"react-native-acoustic-mobile-push-location": true,
"react-native-acoustic-mobile-push-beacon": true,
"react-native-acoustic-mobile-push-geofence": true
}
}
- Important: to apply the changes, run the following Node.js command from the root project directory.
node node_modules/react-native-acoustic-mobile-push/postinstall.js ./
Option B: using package managers
In a terminal, navigate to the root project directory and run an installation command with the name of the plugin. Here is an example.
yarn add react-native-acoustic-mobile-push-location
npm install --save react-native-acoustic-mobile-push-location
Related pages
Updated 15 days ago