Adapt your mPaaS push service to HONOR Push so that apps can continue to reach HONOR devices through the manufacturer channel.
Background
HONOR announced that all new devices released in 2024 and later support only HONOR Push. Existing devices will complete the push service migration by Q1 2024 and will no longer support Huawei Push. To ensure that apps using the mPaaS push service can still reach HONOR devices through the manufacturer channel, complete the HONOR Push adaptation as soon as possible.
Client upgrade
If you use the 10.2.3 baseline, upgrade to version 10.2.3.38 or later.
If you use a different custom baseline, contact the mPaaS helpdesk for confirmation.
Integrate HONOR Push with mPaaS on Android
HONOR Push integration involves three steps:
Register HONOR Push
Log in to the HONOR developer website, register an account, and enable the push service. Enable the push feature.
Integrate HONOR Push
Add the Push> HONOR component by following the steps in Add a push SDK.
NoteThe Push> HONOR component contains only the adaptation code. You must add the HONOR Push SDK dependency separately.
Add the baseline version (10.2.3.38 or later) and the HONOR Push SDK dependency:
implementation platform("com.mpaas.android:mpaas-baseline:10.2.3-38") implementation 'com.mpaas.android:push-honor'Prepare a development environment compatible with HONOR Push. Development preparation> Environment information.
Download the
mcs-services.jsonfile from the HONOR Developer Service Platform and add it to your project. Add an application configuration file.Configure the SDK Maven repository address. Configure the URL of the Maven repository for the SDK.
Add the following dependency to the application-level
build.gradlefile. Add dependencies.dependencies { // Add the following configuration implementation 'com.hihonor.mcs:push:7.0.61.302' }Check Version information for available updates.
The mPaaS-bundled version is 7.0.61.302. You can use a later version if needed. The manufacturer SDK is generally backward compatible.
To use obfuscation, add the relevant obfuscation configuration:
Add the obfuscation script for all integration methods.
If you use the AAR integration method, you must add a confusion rule.
Test HONOR Push
Start the app on an HONOR phone and verify that the initialization method is called. For more information, see Quick Start. The push SDK then obtains and reports the HONOR Push token.
After the app starts, manually exit it and send a test push message:
If you receive the message, HONOR Push integration is successful.
If you do not receive the message, troubleshoot as follows.
Troubleshoot client issues
Verify that the HONOR configuration parameters match the HONOR Push console settings, the required entries are added in
AndroidManifest.xml, andcom.hihonor.push.app_idmatches the value in the HONOR Push console.Verify that the
mcs-services.jsonfile exists and is in the correct location.Verify that the HONOR channel is enabled in the mPaaS console. Configure the Honor channel.
View the logcat logs for troubleshooting:
In the push process, filter by
mPush.PushProxyFactoryand check for the following log:D/mPush.PushProxyFactory: found proxy com.mpaas.push.external.honor.CreatorIn the main process, filter by mHonor and check whether the token is obtained. If
get token failedappears, look up the error code in Error codes.In the main process, filter by
report channel tokenand check whether the HONOR manufacturer token is reported successfully. If the following log appears:report channel token error: xxxxThis means the manufacturer token failed to report. Verify that the
base64Codein adding the configuration file to the project has a value and the APK signature matches the one uploaded when obtaining the configuration file.If the Push> HONOR component is not available, verify that the HONOR component has been added.
Server configuration
Configure HONOR Push Channel
In the left-side navigation pane, choose Message Push> Settings> Channel Configuration.
Click Configure in the upper-right corner of the HONOR Push Channel configuration section. The configuration entry is displayed.
Parameter | Required | Description |
Status | Yes | Toggle for HONOR Push channel integration. Turn on to integrate; turn off to disable. |
SDK package | Yes | Custom HONOR application package name. |
HONOR AppID | Yes | Unique application identifier generated when you activate HONOR Push on the developer platform. |
HONOR Application ID | Yes | Client ID used to obtain the push token. Generated when you activate HONOR Push on the developer platform. |
HONOR Application Key | Yes | Application key from the HONOR developer platform. |
Obtain the package name, application ID, and key from HONOR Developer Alliance > Management Center > My Products > mobile application Details.
Click OK to save the configuration.
Verify HONOR Push integration
Install the app with the updated mPaaS push SDK on an HONOR phone running Magic OS 8.0 or later. Start the app, then manually exit it. In the mPaaS console, use Minimal Message Push> Priority Manufacturer Channel Policy to send a push notification to the target device. If the HONOR device receives the notification, the integration is successful.