ChatPushNotificationIntegration

Manages push notification registration and deregistration for the SDK.

Use this object to register or remove device push tokens so that the user receives notifications for incoming chat messages when the app is in the background.

Prerequisites:

  • A configured MessengerAccount with a valid deployment ID and domain.

  • An FCM registration token obtained from Firebase Cloud Messaging.

  • Push notification integration is properly configured in the deployment settings.

Usage:

lifecycleScope.launch {
ChatPushNotificationIntegration.setPushToken(applicationContext, fcmToken, account)
.onSuccess {
// Push token registered.
}
.onFailure { error ->
// Registration failed with error.
}
}

Important: Push token registration should be performed each time the app receives a new device token (for example, in FirebaseMessagingService.onNewToken).

Functions

Link copied to clipboard
suspend fun removePushToken(context: Context, account: MessengerAccount): Result<Unit>

Removes the previously registered push token from the Genesys Cloud backend.

Link copied to clipboard
suspend fun setPushToken(context: Context, deviceToken: String, account: MessengerAccount): Result<Unit>

Registers a device push token with the Genesys Cloud backend for receiving chat notifications.