Chat / Flutter
Chat Flutter v3
Chat Flutter
Chat
Flutter
Version 3
Home
/
Chat
/
Flutter
/
Message

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.

FirebaseMessaging.onMessage.listen((RemoteMessage message) {
    ...
    Sendbird.markAsDelivered({required Map<String, dynamic> data});
    });

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 onDeliveryReceiptUpdated() method of the channel event handler.

class MyClass with ChannelEventHandler {

    @override
    void onMessageReceived(BaseChannel channel, BaseMessage message)  {
    }
 
    @override
    void onDeliveryReceiptUpdated(GroupChannel channel) {
    }
}