2.2.6-beta • Published 5 months ago

cordova-plugin-mergn v2.2.6-beta

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

MERGN SDK CORDOVA 2.8.1

This documentation provides integration steps and usage instructions for incorporating the MERGN CORDOVA SDK 2.8.1 (Android/IOS) into your project. Follow these steps to initialize the SDK setup, record events, and manage attributes within your application.

Integration Steps

1. Include SDK in Your Project

  1. Place mergn_sdk_cordova_3.1.2.aar in the following directory:
    platforms/android/app/src/main/libs

2. Add Dependencies in build.gradle (app)

Add the following dependencies to your build.gradle (app):

implementation files('src/main/libs/mergn_sdk_cordova_2.8.1.aar') // Add latest version
implementation "androidx.room:room-runtime:2.4.0"
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation "com.android.installreferrer:installreferrer:2.2"
implementation "androidx.work:work-runtime-ktx:2.7.0"

3. Sync the Project

Make sure to sync your project after adding the dependencies.

4. Add the Cordova Plugin

Run the following command in the root directory of your Cordova project:

cordova plugin add cordova-plugin-mergn@2.2.1  // Add Latest Version

5. Update config.xml

Add the following feature in your config.xml:

<feature name="Mergn">
  <param name="android-package" value="nl.xservices.plugins.Mergn" />
</feature>

6. Include Mergn JavaScript in Your HTML

Add the following script tag to your index.html:

<script type="text/javascript" src="js/Mergn.js"></script>

Usage

1. Initiate MERGN SDK Setup

To initialize the SDK, use the following command:

window.plugins.mergn.RegisterApi({
    apiKey: "Enter API Key Here"
});

2. Record Events

To record events, provide the event name and properties:

var eventPropertiesMap = new Map(); // In case of no property
// var eventPropertiesMap = { // In case of properties
//     "propertyName": "value"
// };
var eventPropertiesJSON = JSON.stringify(eventPropertiesMap);

window.plugins.mergn.PerformEvent({
    eventName: "PropertyName",
    eventPropertiesMap: eventPropertiesJSON
});

3. Record Attributes

To record attributes, provide the attribute name and value:

window.plugins.mergn.SendAttribute({
    attributeName: "AttributeName",
    attributeValue: "AttributeValue"
});

4. Login

To record the login event when the user successfully logs in, use the following method:

window.plugins.mergn.Login({
    uniqueIdentifier: "Unique Identifier"
});

Unique Identity (mandatory): This value is the customer's unique identity in your database, such as an ID or email.

2.2.5-beta

5 months ago

2.2.6-beta

5 months ago

2.2.4-beta

5 months ago

2.2.3-beta

6 months ago

2.1.2

8 months ago

2.1.1

8 months ago

2.1.8-beta

8 months ago

2.2.2

8 months ago

2.1.6-beta

8 months ago

2.1.9-beta

8 months ago

2.1.7-beta

8 months ago

2.1.5-beta

8 months ago

2.1.2-beta

8 months ago

2.0.2-beta

8 months ago

2.1.3-beta

8 months ago

2.1.4-beta

8 months ago

2.0.1

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.1.2

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago