The Meizu push channel is a system-level push channel officially provided by Meizu. On a Meizu phone, push messages can be delivered through Meizu's system channel without opening the application.
Note:
- For the Meizu push channel, the notification title cannot contain more than 32 characters, and the notification content cannot contain more than 100 characters.
- The Meizu push channel does not support in-app messages.
- The Meizu channel supports arrival callback and click callback but not passthrough.
AppID
, AppKey
, and AppSecret
. For more information, please see the Meizu development documentation.AppId
, AppKey
, and AppSecret
parameters of the application into TPNS Console > Configuration Management > Basic Configuration > Meizu Official Push Channel.implementation 'com.tencent.tpns:meizu:[VERSION]-release'// Meizu Push [VERSION] is the version number of the current SDK, which can be viewed in SDK for Android Updates
Note:
Meizu Push [VERSION] is the version number of the current SDK, which can be viewed in SDK for Android Updates.
Other-Push-jar
folder and import the jar packages related to Meizu Push. Import mz4tpns1.1.2.1.jar
to the project folder:<application>
<service
android:name="com.meizu.cloud.pushsdk.NotificationService"
android:exported="true"/>
<receiver android:name="com.meizu.cloud.pushsdk.SystemReceiver" >
<intent-filter>
<action android:name="com.meizu.cloud.pushservice.action.PUSH_SERVICE_START"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
</application>
<!-- Note: this is the beginning of permission required by Meizu Push -->
<!-- Compatible with Flyme versions below 5.0. Meizu's internal integration pushSDK is required; otherwise, messages cannot be received -->
<uses-permission android:name="com.meizu.flyme.push.permission.RECEIVE"></uses-permission>
<permission android:name="application package name.push.permission.MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="application package name.push.permission.MESSAGE"></uses-permission>
<!-- Compatible with Flyme 3.0 configuration permissions -->
<uses-permission android:name="com.meizu.c2dm.permission.RECEIVE" />
<permission android:name="application package name.permission.C2D_MESSAGE"
android:protectionLevel="signature">
</permission>
<uses-permission android:name="application package name.permission.C2D_MESSAGE"/>
<!-- Note: this is the end of permission required by Meizu Push -->
Receiver
in AndroidManifest.xml
and configure it as follows:<receiver android:name="com.tencent.android.mzpush.MZPushMessageReceiver">
<intent-filter>
<!-- Receive push message -->
<action android:name="com.meizu.flyme.push.intent.MESSAGE" />
<!-- Receive register message -->
<action android:name="com.meizu.flyme.push.intent.REGISTER.FEEDBACK"/>
<!-- Receive unregister message -->
<action android:name="com.meizu.flyme.push.intent.UNREGISTER.FEEDBACK"/>
<action android:name="com.meizu.c2dm.intent.REGISTRATION" />
<action android:name="com.meizu.c2dm.intent.RECEIVE" />
<category android:name="application package name"></category>
</intent-filter>
</receiver>
stat_sys_third_app_notify
in the drawable folders with different resolutions. For more information, please see the flyme-notification-res
folder in the TPNS SDK for Android.Configure the following code before starting TPNS and calling XGPushManager.registerPush
:
// Set Meizu `APPID` and `APPKEY`
XGPushConfig.enableOtherPush(context, true);
XGPushConfig.setMzPushAppId(this, APP_ID);
XGPushConfig.setMzPushAppKey(this, APP_KEY);
The log of successful registration is as follows:
// The tokens of TPNS and Meizu are successfully obtained, and the binding is successful, indicating that the registration is successful.
I/TPush: [OtherPushClient] handleUpdateToken other push token is : V5R5b7c02********47744c6b635e464b527e487802 other push type: meizu
I/TPush: [PushServiceBroadcastHandler] >> bind OtherPushToken success ack with [accId = 150000**** , rsp = 0] token = 0398291156ce7d2f****66bd0952c87c372f otherPushType = meizu otherPushToken = V5R5b7c02********47744c6b635e464b527e487802
If you need to get parameters through the click callback or redirect to a custom page, you can use the intent to do so. For more information, please see Android.
-dontwarn com.meizu.cloud.pushsdk.**
-keep class com.meizu.cloud.pushsdk.**{*;}
Note:
If the Meizu token can be normally registered with the Debug version of the application but cannot be obtained from the Release version, please check whether the above code obfuscation rules are added.
android.enableR8 = false
in gradle.properties
proguard-rules.pro
file at the application project level.The arrival receipt for the Meizu channel should be configured by yourself. After configuring this feature as instructed in Receipt Configuration Guide for Meizu Channel, you can view the arrival data for the Meizu push channel in the push records.
Was this page helpful?