Skip to content

Instantly share code, notes, and snippets.

@aditrioka
Created August 9, 2019 09:02
Show Gist options
  • Save aditrioka/034c4f573ae611cefea1b65ecfeacc52 to your computer and use it in GitHub Desktop.
Save aditrioka/034c4f573ae611cefea1b65ecfeacc52 to your computer and use it in GitHub Desktop.
firebase messaging service
// we added several line in this code
class MyFirebaseMessagingService : MoEFireBaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage?) {
super.onMessageReceived(remoteMessage)
if (remoteMessage == null) return
val pushPayload = remoteMessage.data
if (MoEngageNotificationUtils.isFromMoEngagePlatform(pushPayload)) {
PushManager.getInstance().pushHandler?.handlePushPayload(this, pushPayload)
return
}
Log.d(tag<MyFirebaseMessagingService>(), "Message data payload: ${remoteMessage?.data}")
Log.d(tag<MyFirebaseMessagingService>(), "Message Notification Body: ${remoteMessage?.notification?.body}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment