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

{
    //General configuration
    "facebookAppId":"your-facebook-app-id", //Facebook application id

    //iOS Configuration
     //Base
    "ios_partnerId":"{ios_partnerId}", // * Accengage partnerId of your iOS App
    "ios_privateKey":"{ios_privateKey}", // * Accengage privateKey of your iOS App
    "ios_allowPushNotification":true, // Use iOS push notifications feature

    //Android Configuration
    //Base
    "android_partnerId":"your-partner-id", // * Accengage partnerId of your Android App
    "android_privateKey":"your-private-key", // * Accengage privateKey of your Android App

    //Push (GCM)
    "android_senderId":"gcm:your-sender-id", // GCM sender id. Example : 123456
    "android_notifications_icon":"your-icon-name", // Icon (embedded in your app into res/drawable- folders) to use for push notification into android notification center
    "android_notifications_accent_color":"#ccc", // Accent color to use for notification icon into android notification center (Android 5.0+)

    //Others
    "android_use_advertiser_id":true, // Use Google Advertiser Id
    "android_no_geoloc":false, // If true, deactivate Geolocation feature
    "android_activate_logging" : true // Display logs, please change it to false before production
}

 

Then call cordova prepare or/and cordova build


Some functions requires 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"}

 

Example

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

Advanced Integration

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