Discontinuation of Xiaomi Push Service
Xiaomi has issued a notice regarding the discontinuation of the Mi Push service outside Mainland China, due to operational concerns. You may have already received communication about this change. For complete details, please refer to the official Shutdown Notice:Shutdown Notice of Mi Push Service Outside Mainland China
![](https://files.readme.io/70fa9ad-Screenshot_2024-02-12_at_10.28.06_AM.png)
Impact of Shutdown
- This shutdown affects notifications delivered solely via Xiaomi Mi Push Service.
- After April 2, 2024: We will no longer be able to send or receive push notifications through Mi Push.
- For a smooth transition, Netcore will continue the Mi Push service for Xiaomi devices until March 31st, 2024. In parallel, we continue to send notifications via FCM to Xiaomi devices, and the push amplification feature continues to be available.
- Action required if you have integrated Netcore Xiaomi Push SDK - we highly recommend removing the Xiaomi push integration at the earliest. This must be done immediately to prevent any potential errors on app side. The steps to do so are mentioned below
Steps to Remove Xiaomi SDK integration
Please follow the below steps to remove the xiaomi push sdk from the app.
1: Delete Mi Push SDK aar file
- Navigate to libs folder on the app module
- Delete the MiPushSDK_Client[version].aar
Follow below steps to remove the smartech xiaomi push sdk integration
Xiaomi Push handled by Smartech Push Xiaomi SDK
2: Remove dependency of Mi SDK
Remove the below integration from the build.gradle of the app module.
dependencies {
implementation fileTree(dir: 'libs', include: ['MiPush_SDK_Client_[sdk_version].aar'])
//your other app level dependencies
}
3: Remove SmartPushXiaomi SDK dependency
Remove SmartPushXiaomi dependency from the app-level build.gradle file.
dependencies {
implementation 'com.netcore.android:smartech-push-xiaomi:3.3.0'
//your other app level dependencies
}
4: Remove the Xiaomi SDK registration via SmartPushXiaomi SDK
Remove the below-mentioned code from the onCreate() method of your Application class which was used to initialize the Smartech Push Xiaomi SDK.
@Override public void onCreate() {
super.onCreate();
SmartPushXiaomi.getInstance(new WeakReference<>(this)).register(appId, appKey, region);
}
override fun onCreate() {
super.onCreate()
SmartPushXiaomi.getInstance(WeakReference<>(this)).register(appId, appKey, region)
}
Xiaomi Push Handled by the Application
When the application is handling the Xiaomi token registration, then the application passes the Xiaomi token and the push payload to smartech Xiaomi push SDK to render notification.
Remove the push token passing
Remove the below line of code on your CustomXiaomiPushReceiver onReceiveRegisterResult
function.
SmartPushXiaomi.getInstance(new WeakReference<>(this)).setXiaomiPushToken(token, MiPushClient.getAppRegion(context));
SmartPushXiaomi.getInstance(WeakReference<>(this)).setXiaomiPushToken(token, MiPushClient.getAppRegion(context))
Remove the handle push notification code
Remove the below line of code on your CustomXiaomiPushReceiver onReceivePassThroughMessage
function.
boolean isPushFromSmartech = SmartPushXiaomi.getInstance(new WeakReference<>(this)).isNotificationFromSmartech(message.getContent());
if(isPushFromSmartech) {
SmartPushXiaomi.getInstance(new WeakReference<>(this))
.handleXiaomiNotification(message.getContent());
}
val isPushFromSmartech = SmartPushXiaomi.getInstance(WeakReference<>(this)).isNotificationFromSmartech(message.getContent())
if(isPushFromSmartech) {
SmartPushXiaomi.getInstance(WeakReference<>(this))
.handleXiaomiNotification(message.getContent())
}
Note: Please cleanup your code if there is any additional Xiaomi SDK integrations followed.
Updated 3 months ago