HMS

object HMS

Push token related class specifically for Huawei Message Service, HMS.

Since

3.0.133

Properties

Link copied to clipboard

Gets the pending HMS push token.

Functions

Link copied to clipboard

Gets Do-not-disturb option for the current User.

Link copied to clipboard

Requests push tokens of current user from given token. The result is passed to handler.

Link copied to clipboard

Gets push notification sound path for the current User.

Link copied to clipboard

Gets push template option for the current User. For details of push template option, refer to setPushTemplate. This can be used, for instance, when you need to check the push notification content preview is on or off at the moment.

Link copied to clipboard

Gets the current User's push trigger option. Refer to PushTriggerOption. For details of push trigger option, refer to setPushTriggerOption.

Link copied to clipboard

Gets snooze period for the current User.

Link copied to clipboard

Registers push token for the current User to receive push notification. To enable push notification and get a token, refer to Sendbird Docs.

Push token registration succeeds only when the connection (connect) is made. Otherwise, callback will return with PushTokenRegistrationStatus.PENDING status. Then you can register push token again by calling this method with pushToken which is provided by HMS as the token parameter, after the connection is done. This just adds token to the server. If you want to register this token and delete all the previous ones, refer to registerPushToken.

Registers push token for the current User to receive push notification. To enable push notification and get a token, refer to Sendbird Docs.

Push token registration succeeds only when the connection (connect) is made. Otherwise, callback will return with PushTokenRegistrationStatus.PENDING status. Then you can register push token again by calling this method with pushToken which is provided by HMS as the token parameter, after the connection is done.

Link copied to clipboard
fun setDoNotDisturb(doNotDisturbOn: Boolean, startHour: Int, startMin: Int, endHour: Int, endMin: Int, timezone: String, handler: CompletionHandler?)

Sets Do-not-disturb option for the current User. If this option is enabled, the current User does not receive push notification during the specified time repeatedly. If you want to snooze specific period, use setSnoozePeriod.

Link copied to clipboard

Sets the push notification sound file path for the current User. This setting will be delivered on push notification payload.

Link copied to clipboard
fun setPushTemplate(templateName: String, handler: CompletionHandler?)

Sets push template option for the current User. The only valid arguments for template name are PUSH_TEMPLATE_DEFAULT and PUSH_TEMPLATE_ALTERNATIVE. If PUSH_TEMPLATE_DEFAULT is set, the push notification will contain the original message in the message field of the push notification. If PUSH_TEMPLATE_ALTERNATIVE is set, message of push notification will be replaced by the content you've set on Sendbird Dashboard.

Link copied to clipboard

Sets the current User's push trigger option. If certain channel's push trigger option is set to GroupChannel.PushTriggerOption.DEFAULT, it works according to the state of PushTriggerOption. If not, push messages will be triggered according to the state of GroupChannel.PushTriggerOption. Refer to GroupChannel.PushTriggerOption.

Link copied to clipboard
fun setSnoozePeriod(snoozeOn: Boolean, startTs: Long, endTs: Long, handler: CompletionHandler?)

Sets snooze period for the current User. If this option is enabled, the current User does not receive push notification during the given period. It's not a repetitive operation. If you want to snooze repeatedly, use setDoNotDisturb.

Link copied to clipboard

Unregisters push token for the current User.

Link copied to clipboard

Unregisters all push token bound to the current User.