Created
August 9, 2019 09:02
-
-
Save aditrioka/034c4f573ae611cefea1b65ecfeacc52 to your computer and use it in GitHub Desktop.
firebase messaging service
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
// 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