360dialog Cordova SDK

This is the 360dialog mobile Cordova SDK. You can find below the insturctions for a quick start. For more detailed documentation, please refer to our Developer Portal

badge-languages badge-pms

Installation

Add the cordova-plugin-d360 directly from the master branch using

cordova plugin add https://github.com/360dialog/sdk-cordova.git#master

Config.xml

The only parameters you need to supply in your app's the config.xml are the app_id and api_key for each platform. Note that the api key differs from one platform to another so make sure you use the correct one

<platform name="android">

    <preference name="com.threesixtydialog.app_id" value="80" />
    <preference name="com.threesixtydialog.api_key" value="434ac9d ...." />
</platform>

<platform name="ios">
    <preference name="com.threesixtydialog.app_id" value="80" />
    <preference name="com.threesixtydialog.api_key" value="d3cdc1f5d3 ...." />

</platform>

Events

You can send any custom events with optional key/value parameters using

var eventParams = {
    "custom_param_a": 123,
    "custom_param_b": "xyz",
    "custom_param_c": true
};

D360.events.logCustomEvent("my_custom_event", eventParams);

or use the predefined SDK methods such as


D360.events.logAddToCart("AB123456789", "iPhone 7", 759, "EUR", null);

See the D360EventService class for more.

Sample app

A sample app showing the SDK usage can be found in the sample directory.

cd sample

cordova platform add ios
cordova platform add android