Integration

Installation

cordova plugin add cordova-plugin-webengage --fetch

Integration

To install WebEngage for your Cordova App, you'll need to take three basic steps.

  1. Add global configuration to the plugin's we_config.xml file.

  2. Add platform specific configuration to we_config.xml file

  3. Initialise the plugin.

1. Global Configuration

Open we_config.xml file within the plugins\cordova-plugin-com-webengage directory inside your app's root directory. All global configuration goes under the config tag.

  1. licenseCode: Obtain your license code from the WebEngage dashboard and paste it within the licenseCode tag.
  1. debug (optional) : Debug logs from SDK's are printed if the value of this tag is true. Default value of this tag is false.
<config>
  <licenseCode>~12345678</licenseCode>
  <debug>false</debug>
  ...
  ...
</config>

2. Platform specific Configuration

Android

All android specific configuration goes under the android tag under the global config tag.

packageName: Insert your complete android application package name with packageName tag.

<config>
  ...
  <android>
    ...
    <packageName>com.hello.world</packageName>
    ...
  </android>
</config>

iOS

In iOS there is no mandatory configuration required for the app. For advanced configuration, check the Other Configurations section.

3. Initialise the plugin

In your onDeviceReady callback call:

onDeviceReady: function() {

/**
Additional WebEngage options and callbacks to be 
registered here before calling webEngage.engage()
**/

webengage.engage();
}

Integration