/ SDKs / Android
SDKs
Chat SDKs Android v4
Chat SDKs Android
Chat SDKs
Android
Version 4

Mark push notifications as delivered

Copy link

You can now track whether push notifications has been successfully delivered to all the intended devices by the Sendbird server. Using the SendbirdPushHelper.markPushNotificationAsDelivered() method, you can mark a push notification as delivered to a device. To ensure proper functionality, the SendbirdChat.init() method must be called within the Application.onCreate() method.

In order to check the delivery rate of push notifications, the SDK retrieves the tracking ID for push notifications and is sent to the server to identify which push notification has been successfully delivered to the device.

class FirebaseMessagingServiceEx : FirebaseMessagingService() {
    override fun onMessageReceived(remoteMessage: RemoteMessage) {

        // SendbirdChat.init() must be called prior to this call.
        SendbirdPushHelper.markPushNotificationAsDelivered(remoteMessage.data)
    }
}

Note: If your app is using Multi-device support and has implemented either of SendbirdPushHandler or SendbirdHmsPushHandler, this will be called internally so that the app doesn't have to handle it directly.