All Products
Search
Document Center

Mobile Platform as a Service:mPaaS Adapts to Honor manufacture Push

Last Updated:Dec 14, 2023

Background information

Recently, we received an official notice from HONOR that the new machines recently released by HONOR Brand and the new machines released in 2024 only support HONOR Push. The stock equipment plans to complete the push service upgrade in Q1 in 2024. At that time, the stock equipment only supports HONOR Push and no longer supports Huawei Push. In order to ensure that apps connected to mPaaS push service can continue to be pushed to HONOR devices through the manufacturer channel, it is recommended that you complete the adaptation and upgrade of HONOR push as soon as possible according to the following guidelines.

Client upgrade-related matters

  • If you use the 10.2.3 baseline, please upgrade the version to 10.2.3.38 or later.

  • If a different custom baseline is currently in use, please contact the mPaaS helpdesk for confirmation.

mPaaS HONOR Push Adapts to Android integration

The following describes the integration process of HONOR Push, which mainly includes the following three steps.

  1. Register HONOR Push

  2. Integrate HONOR Push

  3. Test HONOR Push

Register HONOR Push

login HONOR development official website, registered account and open push service. For more information, see Enable the push feature.

Integrate HONOR Push

  1. Add the Push> HONOR component in the same way as you add the push SDK. For more information, see Add a push SDK.

    Note

    The Push> HONOR component contains only the adaptation code and does not contain the Honor Push SDK. You must add the Honor Push SDK dependency separately.

    Introduce the baseline version (10.2.3.38 or later) of the corresponding version and add the SDK dependency for Honor Push. The sample code is as follows:

    implementation platform("com.mpaas.android:mpaas-baseline:10.2.3-38")
    implementation 'com.mpaas.android:push-honor'
  2. Prepare the development environment. The development environment must be compatible with the integration environment of Honor Push. For more information, see Development preparation> Environment information.

  3. Add a configuration file. Download the mcs-services.json configuration file from the HONOR Developer Service Platform. For more information, see Add an application configuration file.

  4. Configure the repository address of the SDK. For more information, see Configure the URL of the Maven repository for the SDK.

  5. Add dependency configurations. In the application-level build.gradle file, add the following compilation dependencies to the dependencies field: For more information, see Add dependencies.

    dependencies {
        // Add the following configuration
        implementation 'com.hihonor.mcs:push:7.0.61.302'
    }
    • For more information about how to update the version, see Version information.

    • The current version of mPaaS is 7.0.61.302. If you want to use a later version, you can modify it as required. Generally, the manufacture SDK will backward compatible it.

  6. To use obfuscation, add the relevant obfuscation configuration:

Test HONOR Push

  1. After you enable Honor Push, you can start the application on the Honor mobile phone and make sure that the initialization method is called. For more information, see Quick start. Then, the push SDK obtains the token of the Honor Push provider and reports the token.

  2. You can manually exit the app some time after it starts, and then push a test message:

    • If you still receive messages, your application is successfully connected to HONOR Push.

    • If you cannot receive the message, troubleshoot the issue as follows.

Troubleshoot client issues

  1. Check whether the HONOR configuration and parameters are consistent with the HONOR push background, whether the relevant configuration is added in the AndroidManifest.xml, and whether the com.hihonor.push.app_id is consistent with the HONOR push background.

  1. Check whether the mcs-services.json file exists and whether the storage location is correct.

  2. Check whether the Honor channel is enabled in the mPaaS console. For more information, see Configure the Honor channel.

  3. View the logcat logs for troubleshooting:

    1. Select the push process, filter the mPush.PushProxyFactory, and check whether the following logs exist:

      D/mPush.PushProxyFactory: found proxy com.mpaas.push.external.honor.Creator
    2. Select the main process, filter mHonor, and check whether the token is obtained. If a log get token failed appears, the token fails to be obtained. For error codes, see Error codes.

    3. Select the main process, filter the report channel token, and check whether the reporting HONOR manufacturer token is successful. If the following log appears:

      report channel token error: xxxx

      This indicates that the manufacture token fails to be reported. Please check whether the base64Code of adding the configuration file to the project has a value and whether the apk signature uploaded when obtaining the configuration file is consistent with the current application.

      If the Push> HONOR component is not available, the HONOR component may be added. Check whether the HONOR component is added.

Matters related to server upgrade

Configure HONOR Push Channel

  1. In the left-side navigation pane, choose Message Push> Settings> Channel Configuration.

  2. Click Configure in the upper-right corner of the HONOR Push Channel configuration section. The configuration entry is displayed.

Parameter

Required

Description

Status

Yes

The integration status switch of the channel. Turn on the switch, MPS will integrate the HONOR push channel according to the configuration; Turn off the switch, that is, cancel the integration.

SDK package

Yes

Support custom HONOR application package name.

HONOR AppID

Yes

The unique application identifier, which is generated when the HONOR Push service of the corresponding application is activated on the developer platform.

HONOR Application ID

Yes

The customer ID of the application, which is used to obtain the ID of the message sending token. It is generated when the corresponding application PUSH service is activated on the developer platform.

HONOR Application Key

Yes

Enter the key of the app.

  1. You can log on to the HONOR Developer Alliance website and go to the Management Center > My Products > mobile application Details page to obtain the application package name, application ID, and key.

  2. Click OK to save the configuration.

Verify the channel push function of Honor Manufacturer

Use Magic OS 8.0 or above HONOR Mobile Phone and install the App integrated with the new mPaaS push SDK. After the App is started, manually exit the App for a period of time. Use the Minimal Message Push> Priority Manufacturer Channel Policy in the mPaaS Message Push Console to push and distribute the target device. If HONOR terminal can successfully receive the notification bar message, it proves that HONOR Manufacturer Channel Integration is successful.