Marketing Cloud Cordova Plugin

Use the Salesforce Marketing Cloud Cordova Plugin to implement the MobilePush SDK for Android and iOS applications built using the Apache Cordova framework.

Prerequisites 

Before you install the MobilePush SDK plugin for Cordova, install the latest version of Apache Cordova. See Cordova Documentation: Installation.

After you install Cordova, create and configure your app. See Cordova Documentation: Creating an App.

Install the Cordova Plugin 

To install the Cordova plugin in your development environment, complete these steps.

  1. At the command line, run this command to add the plugin to your app.

    1cordova plugin add cordova-plugin-marketingcloudsdk
  2. To configure the plugin, the config.xml file for your app.

    1<!-- Required -->
    2<preference name="com.salesforce.marketingcloud.app_id"
    3     value="{Marketing Cloud Engagement application id}" />
    4<preference name="com.salesforce.marketingcloud.access_token"
    5     value="{Marketing Cloud Engagement access token}" />
    6<preference name="com.salesforce.marketingcloud.tenant_specific_endpoint"
    7     value="{URL retrieved from the Engagement Administration page}" />
    8
    9<!-- Required - Android Only -->
    10<platform name="android">
    11<preference name="com.salesforce.marketingcloud.notification_small_icon"
    12     value="ic_notification" />
    13</platform>
    14
    15<!-- Optional -->
    16<preference name="com.salesforce.marketingcloud.analytics" value="{true|false}" />
    17<preference name="com.salesforce.marketingcloud.delay_registration_until_contact_key_is_set"
    18     value="{true|false}" />
  3. Configure the MobilePush SDK in your app.

    For Android apps, see Configure the MobilePush SDK Cordova Plugin for Android Apps.

    For iOS apps, see Configure the MobilePush SDK Cordova Plugin for iOS Apps.

See Also