ICHMSMessageService
Service to handle Huawei Mobile Services (HMS) push messages.
Service to handle Huawei Mobile Services (HMS) push messages.
Syntax: class ICHMSMessageService : HmsMessageService
Functions
Function Name | Description |
---|---|
onMessageReceived | Called when a message is received. |
onNewToken | Called when a new token for the default HMS project is generated. |
onMessageReceived
This is also called when a notification message is received while the app is in the foreground.
Syntax: override fun onMessageReceived(message: RemoteMessage)
Parameters
Parameters | Type | Description |
---|---|---|
message | RemoteMessage | Remote message that has been received. |
onNewToken
This is invoked after app install when a token is first generated, and again if the token changes.
Syntax: override fun onNewToken(token: String)
Parameters
Parameters | Type | Description |
---|---|---|
token | String | The token used for sending messages to this application instance. |
Updated about 2 months ago