/ SDKs / Flutter
Chat SDKs Flutter v4
Chat SDKs Flutter
Chat SDKs
Version 4

Mark messages as delivered

Copy link

Delivery receipt can be used to see whether a message has been successfully delivered to all the intended recipients by the Sendbird server. To mark a message as delivered when an offline group channel member receives a push notification for the message from Firebase Cloud Messaging, use the markAsDelivered() method.

// App is in the foreground.
FirebaseMessaging.onMessage.listen((RemoteMessage remoteMessage) {
  // ...

// App is in the background.

Future<void> _backgroundMessageHandler(RemoteMessage remoteMessage) async {
  // ...

When a message is delivered to a group channel member who is online, the message is marked as delivered and other members who are online are notified of the delivery receipt through the onDeliveryStatusUpdated() method of the channel event handler.

class MyGroupChannelHandler extends GroupChannelHandler {
  void onDeliveryStatusUpdated(GroupChannel channel) {
    // Delivery status is updated.