This migration is required only for people who have integrated plugin version 3.2.0 or below. If you plugin version is greater 3.2.0 you can ignore this step.
Remove MoEngage SDK Plugin
cordova plugin remove moengagesdk
Remove MoEngage Push Extension, if added. Use the command
cordova plugin list to check whether the plugin is installed or not.
cordova plugin remove moengagepushextension
Install the new MoEngage SDK plugin.
cordova plugin add moengagesdk --variable APP_ID="[your_app_id]"
- APP_ID = App id found under the settings page on the MoEngage dashboard.
To initialise SDK create a class extending
Application class of Android and override
onCreate() initialise the SDK as shown below.
// this is the instance of the application class and "XXXXXXXXXXX" is the APP ID from the dashboard. MoEngage moEngage = new MoEngage.Builder(this, "XXXXXXXXXXX") .build(); MoEngage.initialise(moEngage);
Make sure your application class is defined in the
AndroidManifest.xml file as well.
MoEngage SDK supports both FCM and GCM, based on what you are using in your application install the appropriate plugin.
The SDK no longer ships with Google's GCM or FCM library please ensure you have added the appropriate dependency in your app.
cordova plugin add cordova-moengage-fcm-dependency
cordova plugin add cordova-moengage-gcm-dependency
If MoEngage SDK is registering for push notification add the appropriate FCM/GCM listeners.
cordova plugin add cordova-moengage-fcm-listeners
cordova plugin add cordova-moengage-gcm-listeners
Refer to Push Notification documentation and add all the required meta-data for push notifications to work.
Updated 4 months ago