Skip to content

Instantly share code, notes, and snippets.

@alperenbabagil
Created August 17, 2020 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alperenbabagil/ee6fbf86034dc49a2f5e4883532aee5b to your computer and use it in GitHub Desktop.
Save alperenbabagil/ee6fbf86034dc49a2f5e4883532aee5b to your computer and use it in GitHub Desktop.
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