For the complete documentation index, see llms.txt. This page is also available as Markdown.

Custom HMS Implementation

If your app uses a custom HmsMessageService, follow these steps to integrate it with Netmera.

Step 1: Update the manifest

Add the following line to your AndroidManifest.xml file inside the application tag to remove Netmera’s default HMS service:

<service
    android:name="com.netmera.nmhms.NMHuaweiService"
    tools:node="remove" />

Step 2: Handle incoming HMS messages

Deprecated method

override fun onMessageReceived(remoteMessage: RemoteMessage) {
    super.onMessageReceived(remoteMessage)

    if (Netmera.isNetmeraRemoteMessage(remoteMessage.dataOfMap)) {
        Netmera.onNetmeraPushMessageReceived(remoteMessage)
    } else {
        // Handle other messages
    }
}

Step 3: Report token updates

You must also report HMS push tokens to Netmera.

Last updated

Was this helpful?