Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Receiver side for marking messages as delivered.
//Receiver Side
public class FirebaseMessagingServiceEx extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
try {
JSONObject sendBird = new JSONObject(remoteMessage.getData().get("sendbird"));
JSONObject channel = (JSONObject) sendBird.get("channel");
String channelUrl = (String) channel.get("channel_url");
//Mark the Message as Delivered
SendBird.markAsDelivered(channelUrl);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment