All Products
Search
Document Center

Mobile Platform as a Service:HONOR Push

Last Updated:Sep 27, 2024

This article describes the integration process of HONOR Push, which 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 function.

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 can add the HONOR Push SDK dependency separately as follows.

  2. Prepare the development environment. The development environment must be compatible with the integration environment of HONOR Push. For more information, see Prepare the development environment.

  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 Maven repository address of the SDK.

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

    dependencies {
        // Add the following configuration
        implementation 'com.hiHONOR.mcs:push:7.0.61.302'
    }
    • For more information, see Add dependencies.

    • 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

Important

Please note that the following (excluding 8.0) versions of HONOR Magic OS 8.0 will continue to use the Huawei push adaptation layer.

  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 push a test message when the application process is killed:

    • 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 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.

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

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

  4. 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 in step 3 to add 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, an error may occur when you add the HONOR component. Check whether the HONOR component is added.

Others

What models and system versions are supported?

At present, HONOR's manufacturer push channel supports HONOR mobile phones with Magic OS version 8.0 and above. Versions below Magic OS version 8.0 (excluding 8.0) continue to use Huawei's manufacturer push channel.