Last active
December 25, 2018 21:16
-
-
Save hiranya911/7063d9c22a2d7a51b6cb794ab9330dc0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class CryptoAlertMessagingService: FirebaseMessagingService() { | |
override fun onMessageReceived(message: RemoteMessage?) { | |
message?.notification?.let { | |
Log.d(TAG, "Message Notification Body: ${it.body}") | |
val mainHandler = Handler(mainLooper) | |
mainHandler.post { | |
Toast.makeText(applicationContext, "${it.body}", Toast.LENGTH_SHORT).show() | |
} | |
} | |
} | |
companion object { | |
private const val TAG = "MessagingService" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment