Last active
August 7, 2020 21:42
-
-
Save AlexPrestonSB/d7b5b9c948ab295e7e01b7bf33e383c6 to your computer and use it in GitHub Desktop.
Receiver side for marking messages as delivered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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