Migration to Push Amp Plus 6.x.x

In version 6.0.0 integration for push-amp-plus has drastically changed, due to the integration/library changes made by Xiaomi in version 5.0.0 of their SDK. This document walks you through the integration changes required when updating to push-amp-plus version 6.0.0 or above from an older version of the SDK.

Remove existing integration

As a first step, you would need completely remove the existing integration.

Remove permissions from the manifest file

Remove the below permissions from the manifest file of your application.

AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<permission
	android:name="${applicationId}.permission.MIPUSH_RECEIVE"
	android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.permission.MIPUSH_RECEIVE" />

Remove services and receivers from Manifest

Remove the below services and receivers from the manifest file of your application.

AndroidManifest.xml
<service
    android:name="com.xiaomi.push.service.XMPushService"
    android:enabled="true"
    android:process=":pushservice" />

<service
    android:name="com.xiaomi.push.service.XMJobService"
    android:enabled="true"
    android:exported="false"
    android:permission="android.permission.BIND_JOB_SERVICE"
    android:process=":pushservice" />

<service
    android:name="com.xiaomi.mipush.sdk.PushMessageHandler"
    android:enabled="true"
    android:exported="true" />

<service
    android:name="com.xiaomi.mipush.sdk.MessageHandleService"
    android:enabled="true" />

<receiver
    android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver"
    android:exported="true">
  <intent-filter>
    <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
    <category android:name="android.intent.category.DEFAULT" />
  </intent-filter>
</receiver>

<receiver
    android:name="com.xiaomi.push.service.receivers.PingReceiver"
    android:exported="false"
    android:process=":pushservice">
  <intent-filter>
    <action android:name="com.xiaomi.push.PING_TIMER" />
  </intent-filter>
</receiver>

Remove Push Receiver

Remove the below receiver from the manifest file.

AndroidManifest.xml
<receiver
    android:name="com.moengage.mi.MoEMiPushReceiver"
    android:exported="true">
  <intent-filter>
    <action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE" />
  </intent-filter>
  <intent-filter>
    <action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED" />
  </intent-filter>
  <intent-filter>
    <action android:name="com.xiaomi.mipush.ERROR" />
  </intent-filter>
</receiver>

Remove initialization meta-data

In the initialization of the SDK, you would have added an API configureMiPush(). Remove this API from the initialization Builder.

Update to the new integration

Refer to the Configuring Xiaomi Push for the updating to the latest integration.

 

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?