npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jmozer/cordova-push

v1.0.2

Published

A Cordova Plugin to access the native Salesforce Marketing Cloud MobilePush SDKs

Readme

Salesforce Marketing Cloud Cordova Plugin

This plugin implements the Marketing Cloud Mobile Push SDK for your applications built for iOS and Android.

Release History

Version 1.0.2

Released Jan 22, 2018

Depends on the Marketing Cloud Mobile Push iOS SDK v4.9.x Depends on the Marketing Cloud Mobile Push Android SDK v5.3.x

  • Updated Android SDK to v5.3.+

Version 1.0.1

Released Nov 29, 2017

Depends on the Marketing Cloud Mobile Push iOS SDK v4.9.x Depends on the Marketing Cloud Mobile Push Android SDK v5.2.x

  • Updated Android SDK to v5.2.+

Version 1.0.0

Released October 27, 2017

Depends on the Marketing Cloud Mobile Push iOS SDK v4.9.x Depends on the Marketing Cloud Mobile Push Android SDK v5.0.x

Installing the Plugin

In order to connect this plugin to your Marketing Cloud account, you must follow these provisioning and app creation steps:

Once provisioning and your AppCenter app(s) are setup, install the plugin into your Cordova project with the following command:

cordova plugin add ../MarketingCloudSdk-Cordova-Plugin 
--variable APPID={YOUR_APP_ID} 
--variable ACCESSTOKEN={YOUR_ACCESS_TOKEN} 
--variable GCMSENDERID={YOUR_GCM_SENDER_ID} 
--variable MCANALYTICS={enabled|disabled}
--variable CHANNELNAME={YOUR_CHANNEL_NAME}
--nosave 
--nofetch

Be sure to replace the values with your App's ID, Access Token, GCM Sender ID and Channel Name. Also, you must explicitely choose enabled or disabled for MCANALYTICS.

The following variables should be used in the cordova plugin add command:

| Name | Description | | ---- | ----------- | | APPID | The Application ID for your Salesforce Marketing Cloud AppCenter App | | ACCESSTOKEN | The Access Token for your Salesforce Marketing Cloud AppCenter App | | GCMSENDERID | The GCM Sender ID for your Salesforce Marketing Cloud AppCenter App | | MCANALYTICS | Whether or not you wish to collect notification displayed, opened, etc. analytics | | CHANNELNAME | The Channel Name for your Salesforce Marketing Cloud AppCenter App |

Using the Plugin

After successful installation of your Cordova platform(s) and the plugin, you can begin using the following features of the Marketing Cloud SDK within your javascript in your Cordova app.

Requirements for using plugin

If you are building Cordova for the Android Platform, installing Android Studio is not required. However, gradle is required as a dependancy and you will be required to install the gradle build tool. https://gradle.org/install/#manually

Once you have installed the Gradle build tool, make sure you have also set the enviornment variables path. export PATH=$PATH:/opt/gradle/gradle-4.4.1/bin

When you have completed this, you should be able to build and run your project with the MarketingCloud-Cordova-Plugin.

MCCordovaPlugin

Use the MCCordovaPlugin object in your javascript on or after the device ready or platform ready event. All of the methods below belong to the MCCordovaPlugin object that is automatically provided by the plugin. The MarketingCloudSdk configuration and registration calls will complete behind the scenes. You can just start using MCCordovaPlugin.methodname() within your app.

Contact Key

setContactKey

Sets the Contact Key for this device.

MCCordovaPlugin.setContactKey(successCallback, errorCallback, contactKey);

getContactKey

Gets the Contact Key for this device.

MCCordovaPlugin.getContactKey(successCallback, errorCallback);

The successCallback will include a result parameter in the following format: "contactKey"

Attributes

setAttribute

Adds an attribute to current user's Contact model.

MCCordovaPlugin.setAttribute(successCallback, errorCallback, attributeName, attributeValue);

The successCallback will include a result parameter of "true" or "false":

"true"

clearAttribute

Removes an attribute from current user's Contact model.

MCCordovaPlugin.clearAttribute(successCallback, errorCallback, attributeName);

The successCallback will return the key value that has been removed:

"First Name"

getAttributes

Gets the list of attributes from the current user's Contact model.

MCCordovaPlugin.getAttributes(successCallback, errorCallback);

The successCallback will include a result parameter in the following format:

{
	"attributeName1": "attributeValue1",
	"attributeName2": "attributeValue2",		
	"attributeName3": "attributeValue3"
}

Tags

addTag

Adds a tag to the current user's Contact model.

MCCordovaPlugin.addTag(successCallback, errorCallback, tagName);

removeTag

Removes a tag to the current user's Contact model.

MCCordovaPlugin.removeTag(successCallback, errorCallback, tagName);

getTags

Gets a list of tags from the current user's Contact model.

MCCordovaPlugin.getTags(successCallback, errorCallback);

The successCallback will include a result parameter in the following format:

[
	"tag1",
	"tag2",
	"tag3"
]

Logging

enableVerboseLogging

Enable internal Marketing Cloud SDK logging

MCCordovaPlugin.enableVerboseLogging(successCallback, errorCallback);

disableVerboseLogging

Disable internal Marketing Cloud SDK logging.

MCCordovaPlugin.disableVerboseLogging(successCallback, errorCallback);

Misc

isPushEnabled

Checks persistent preferences for the state of Push.

MCCordovaPlugin.isPushEnabled(successCallback, errorCallback);

The successCallback will include a result parameter in the following format: true/false

getSystemToken

Get the System Token of the Marketing Cloud SDK.

MCCordovaPlugin.getSystemToken(successCallback, errorCallback);

The successCallback will include a result parameter in the following format: "systemToken"

enablePush

Enables push and push accessories in the SDK.

MCCordovaPlugin.enablePush(successCallback, errorCallback);

disablePush

Disables push and push accessories in the SDK.

MCCordovaPlugin.disablePush(successCallback, errorCallback);