public abstract class

EmergencyAlertsFirebaseMessagingService

extends FirebaseMessagingService
java.lang.Object
   ↳ FirebaseMessagingService
     ↳ com.mapsted.alerts.services.EmergencyAlertsFirebaseMessagingService

Class Overview

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.

Summary

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
From class java.lang.Object

Constants

public static final String EXTRA_ALERT_JSON_DATA

Constant Value: "AlertJsonData"

Public Constructors

public EmergencyAlertsFirebaseMessagingService ()

Public Methods

public void onCreate ()

public Notification onCreateNotification (String title, String messageBody, Intent targetIntent)

If you would like to provide your own implementation of notification, overwrite this method. Otherwise a default notification will be created for you.

Parameters
title emergency alert title
messageBody emergency alert message body
targetIntent an intent with extra information about the alert including deeplink uri
Returns
  • a notification or null

public void onMessageReceived (RemoteMessage remoteMessage)

Called when message is received.

Parameters
remoteMessage Object representing the message received from Firebase Cloud Messaging.

public abstract void onNewToken (String firebaseToken)

When a new token gets generated. You should send this token to the server by sendFirebaseTokenForEmergencyAlerts(Context, CoreApi, String)