MoEngage Docs

SDK Integration

To get up and running with MoEngage on Cordova, there a couple of steps to get you there.

Current Cordova plugin is not compatible with the android compile SDK version 26 and above. Please write to us at if your app targets SDK version 26 or above.

Adding MoEngage Plugin

Add moengagesdk plugin to cordova project as shown below :

cordova plugin add moengagesdk --variable APP_ID="[your_app_id]" --variable SENDER_ID="[your_sender_id]" --variable NOTIFICATION_ICON="[notification_small_icon_drawable]" --variable NOTIFICATION_TYPE="[single/multlipe]" --variable NOTIFICATION_LARGE_ICON="[notification_small_icon]" --variable SKIP_GCM_REGISTRATION="[whether_moengage should_register for push]"

Variables :

  • APP_ID = App id found under the settings page on the MoEngage dashboard.
  • SENDER_ID = The project number as mentioned on GOOGLE CLOUD CONSOLE PROJECTS PAGE, prefix "id:" to the project number
  • NOTIFICATION_ICON = The notification small icon which will be used to set to notifications posted
  • NOTIFICATION_TYPE = The notification type which will be used, SINGLE OR MULTIPLE. Use @integer/notification_type_single for single, use @integer/notification_type_multiple for multiple
  • NOTIFICATION_LARGE_ICON = The notification large icon which will be used to set to notifications posted.
  • SKIP_GCM_REGISTRATION = false, If you want MoEngage to register for Push Notification, else true.

Adding Lifecycle Callbacks for Android

Add activity lifecycle callbacks.
Where to find your CordovaActivity?

public class BaseActivity extends Activity {
  private MoEHelper mHelper;

  protected void onCreate(Bundle savedInstanceState) {
    mHelper = MoEHelper.getInstance(this)

  protected void onStart() {

  protected void onStop() {

  protected void onResume() {

  protected void onSaveInstanceState(Bundle outState) {

  protected void onRestoreInstanceState(Bundle savedInstanceState) {

BaseActivity is a placeholder activity, add to the activities present in your application

In case you are facing issues with the import add the below import statement in your java file.


iOS Integration

Set -ObjC linker flag :

Open your project in Xcode, select your project. Go to Build Settings -> Linker -> Other Linker Flags and add -ObjC flag.

Only for moengagesdk plugin version 2.0.1 and earlier

Make changes in your appdelegate class as mentioned in the following link

SDK Integration

To get up and running with MoEngage on Cordova, there a couple of steps to get you there.