java.lang.Object | ||
↳ | FirebaseMessagingService | |
↳ | com.mapsted.alerts.services.EmergencyAlertsFirebaseMessagingService |
A FirebaseMessagingService to receive emergency alerts. Extend this class and implement FirebaseMessagingService#onNewToken(String) to send the new token to Mapsted server with com.mapsted.positioning.core.network.PostFirebaseToken. Also, do not forget to register your service class in the AndroidManifest.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXTRA_ALERT_JSON_DATA |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
EmergencyAlertsFirebaseMessagingService() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | onCreate() | ||||||||||
Notification |
onCreateNotification(String title, String messageBody, Intent targetIntent)
If you would like to provide your own implementation of notification, overwrite this method.
| ||||||||||
void |
onMessageReceived(RemoteMessage remoteMessage)
Called when message is received.
| ||||||||||
abstract void |
onNewToken(String firebaseToken)
When a new token gets generated.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
If you would like to provide your own implementation of notification, overwrite this method. Otherwise a default notification will be created for you.
title | emergency alert title |
---|---|
messageBody | emergency alert message body |
targetIntent | an intent with extra information about the alert including deeplink uri |
Called when message is received.
remoteMessage | Object representing the message received from Firebase Cloud Messaging. |
---|
When a new token gets generated.
You should send this token to the server by sendFirebaseTokenForEmergencyAlerts(Context, CoreApi, String)