registerPushToken

suspend fun SendbirdChat.registerPushToken(gcmRegToken: String, unique: Boolean = false): PushTokenRegistrationStatus

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

Since

4.15.0

Parameters

gcmRegToken

GCM push token.

unique

If true, all the previously registered token for the current User will be deleted and this token will be the unique one. Defaults to false.


suspend fun SendbirdChat.HMS.registerPushToken(token: String, unique: Boolean = false): PushTokenRegistrationStatus

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.

Since

4.15.0

Parameters

token

HMS push token.

unique

If true, all the previously registered token for the current User will be deleted and this token will be the unique one. Defaults to false.


fun SendbirdChat.registerPushToken(gcmRegToken: String, unique: Boolean = false, handler: ResultHandler<PushTokenRegistrationStatus>?)

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 registerPushToken after the connection is done.

Since

4.15.0

Parameters

gcmRegToken

GCM push token.

unique

If true, all the previously registered token for the current User will be deleted and this token will be the unique one. Defaults to false.

handler

Callback handler.


fun SendbirdChat.HMS.registerPushToken(token: String, unique: Boolean = false, handler: ResultHandler<PushTokenRegistrationStatus>?)

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.

Since

4.15.0

Parameters

token

HMS push token.

unique

If true, all the previously registered token for the current User will be deleted and this token will be the unique one. Defaults to false.

handler

Callback handler.