Our documentation is changing, please click here to enjoy it!

Skip to end of metadata
Go to start of metadata

Basic Integration

Update the file config/BMA4SCordovaConfig.json with your PartnerID and you privateKey BEFORE preparing/building your app on Cordova.

BMA4SCordovaConfig example:

Please DO NOT copy paste the content of this example (comments are not allowed inside a valid JSON file) Fields with * means REQUIRED

Avoid to simply name your notification icon, "icon" or "android". This could be a problem in case of replacement.


Then call cordova prepare or/and cordova build

Some functions require a function as a callback.

In this doc, this function is always named "theCallback" and can be any JS function.

This callback function always takes only one parameter which can be : the result OR an error.

If an error occurs, you will always get a JSONObject like this one : {"error":"The message of the error"}


Android specific steps

Add in the file yourapp/platforms/android/build-extras.gradle (create the file if necessary):

Kotlin Dependencies

As the SDK contains some Kotlin classes, you must configure Kotlin in your project to avoid SDK Service crashes by adding the kotlin dependences below in your project build.gradle and your app build.gradle.


You can have a list of all available SDK methods by looking at the following file : your-cordova-app/plugins/com.bma4s.sdk.plugins.cordova/example/example.html

If you want to use this file, please copy the content into your-cordova-app/www/index.html and do not forget to copy our stylesheet too (example/css/example.css).


If you still need more information (about methods compatibilities for instance), you can look our JS code at : your-cordova-app/plugins/com.bma4s.sdk.plugins.cordova/www/BMA4S.js

Manage GDPR compliancy

There are two steps for sending user opt-in for data collection to Accengage.

First, there is a parameter that you can override in order to let us know about user opt-in or opt-out for data collection. This parameter is android_optin_data for android Apps and ios_optin_data for iOS Apps in the BMA4SCordovaConfig.json file. Set it to true if you plan to send user opt-in to Accengage.

If the parameter is set to "false" or any other value different from "true", our SDK will automatically be launched without the need of calling the "setOptinData" method.

If it is false, we consider that the user opt-in has been retrieved another way.

Then, you MUST call the method setOptinData before any other methods from the Accengage SDK for letting us know the opt-in state of the user. 

If it is true, the SDK will start normally. Otherwise it will not start and no data will be collected.

Furthermore, you can block or allow the collect of an user's geolocation by calling the method setOptinGeoloc.

 Of course, if setOptinData is set to false, the SDK will not be running, and then the state of setOptinGeoloc will not be used.

Advanced Integration

Please see platform related (iOS,Android) documentation for more information (methods usage, advanced integration..)

  • No labels