MoEngage Docs

Migrating to 7.x.xx

Changes to be made when migrating from older Moengage Android SDKs to v7.x.xx

Removing components

Remove below components from your manifest file

<receiver android:name="" >
        <action android:name="android.intent.action.PACKAGE_REPLACED" />
          android:scheme="package" />

<provider android:name=""
    android:exported="false" />

Change GcmBroadcast Receiver name

If your app uses play services version less than 7.5 and have GCMBroadcastReceiver from Moengage SDK rename it from "" to "com.moengage.receiver.MoEngagePushReceiver". Final component in manifest should be below

<!-- If you have specified applicationId in build.gradle file then replace [YOUR_PACKAGE_NAME] with applicationId-->
<receiver android:name="com.moengage.receiver.MoEngagePushReceiver"
  android:permission="" >
      <action android:name="" />
      <action android:name="" />
      <category android:name="[YOUR_PACKAGE_NAME/applicationId]" />

Removing Lifecycle callbacks for MoEngage SDK(optional)

Note: Minimum API level >= 14
This step is not necessary.Implement only if you want to remove SDK lifecycle callbacks
You can remove lifecycle callbacks for MoEngage SDK and below line of code enable Activity tracking.

public class MyApplcation extends Application
    public void onCreate() {

To opt-out from activity tracking Optouts

Custom Action Class for Push Notification

If you have implemented custom action for push notification then you have to make below changes

  1. Method signature of IActionHandler.onActionPerformed has changed to:
public interface IActionHandler {
    boolean onActionPerformed(Context context, String tag, JSONObject actionObject);
  1. Additionally the developer needs to register to receive a callback for custom actions. This could be done as follows :
PushActionManager.getInstance().registerActionHandler(new IActionHandlerImpl);
  1. Getting payload :
  public boolean onActionPerformed(Context context, String s, JSONObject jsonObject) {
    try {
      if (jsonObject != null) {
        String customPayload = jsonObject.getString("custom_payload");
        if (!TextUtils.isEmpty(customPayload)){
          //your action on the payload
    }catch (JSONException e) {
    return false;

APIs removed

  1. MoEHelper

    • Register(int drawableId)
    • Register(int drawableId, String gcmToken)
    • enableGCMRegistration(Context context, boolean enable)
    • ByPassPushesTo(String serviceClassName)
    • suppressInAppMessageHere(true)
    • onPause(context)
    • setGeoFencesAroundLatLng(final double lat, final double lng, Context con)
  2. PushGCMReceiverHook

Re-import class reference in Java file

  1. MoEngageNotificationUtils

Method Signature Change

  1. PushManager.getInstance()





Updated 2 years ago

Migrating to 7.x.xx

Changes to be made when migrating from older Moengage Android SDKs to v7.x.xx

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.