Created
August 17, 2020 06:46
-
-
Save alperenbabagil/ee6fbf86034dc49a2f5e4883532aee5b to your computer and use it in GitHub Desktop.
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
override fun onMessageReceived(remoteMessage: RemoteMessage?) { | |
super.onMessageReceived(remoteMessage) | |
remoteMessage?.let { | |
if(it.data.isNotEmpty()){ | |
//data message | |
try { | |
val pushDataModel= Gson().fromJson(it.data,PushDataModel::class.java) | |
handleNotification(pushDataMceodel) | |
} | |
catch (e:Exception){ | |
e.printStackTrace() | |
} | |
} | |
it.notification?.let { | |
//notification handling | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment