Huawei integration for Android

Contact Synerise Support

Before you can use Huawei integration, your application must be added to the Synerise database. To do that, contact Synerise Support and provide the following information:

  • hms_app_id
  • hms_project_id
  • hms_app_secret


In order to integrate Huawei Mobile Services with Synerise, you must add .mesaggingServiceType(MessagingServiceType) to your Synerise.Builder.

We recommend passing MessagingServiceType.HMS as an argument when you build the app for AppGallery.

Tip: More information about Synerise.Builder is available in the “Configuration” section of this article.

Implementing Huawei notifications in applications

  1. Register your service in the AndroidManifest:

                <action android:name="com.huawei.push.action.MESSAGING_EVENT" />

  2. In onRegisterForPush, pass the huaweiToken using the Client.registerForPush(token, pushAgreement) method.

  3. Add the Huawei registration method:

    override fun onNewToken(p0: String?, p1: Bundle?) {
        super.onNewToken(p0, p1)
        val call = Client.registerForPush(p0!!, true)
                Log.i(TAG, "Register for Push succeed: $p0")
        ) { apiError: Any? ->
            Log.i(TAG, "Register for push failed:" + apiError.toString())
        Log.i(TAG, p0!!)
        Log.i(TAG, "receive token: $p0")

  4. Pass the incoming push notification payload to the Injector in your HmsMessageService implementation:

       val scope = CoroutineScope(Dispatchers.IO + SupervisorJob())
        override fun onMessageReceived(p0: RemoteMessage?) {
            val data: Map<String, String> = p0!!.dataOfMap
            scope.launch {

Tip: For more information, visit Huawei Codelab.

Huawei Limitations

Banner campaign will only be displayed when your app is in the foreground. When it is in the background, a push notification is not displayed.

In order to implement links and deep links, refer to this instruction.

Configuring notification encryption

Instructions for encrypting push notifications are available here.


We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.



Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker