MetricaMessagingService class
com.yandex.metrica.push.firebase
public class MetricaMessagingService extends FirebaseMessagingService
Methods of the class are used to configure simultaneous working push services: AppMetrica Push SDK and Firebase Cloud Messaging. For more information, see Using with Firebase.
Methods
void | onMessageReceived(@NonNull final RemoteMessage message) Called when a push notification is received from Firebase. For more information, see the method description FirebaseMessagingService.onMessageReceived. |
void | onNewToken(@NonNull String token) Called when the system generates a new push token. For more information, see the FirebaseMessagingService.onNewToken(String token) method description. |
void | processPush(@NonNull final Context context, @NonNull final RemoteMessage message) Sends information about push notification to AppMetrica Push SDK. AppMetrica automatically recognizes own messages and processes only them. |
void | processPush(@NonNull final Context context, @NonNull final Bundle data) Sends information about push notification to AppMetrica Push SDK. AppMetrica automatically recognizes own messages and processes only them. |
void | onMessageReceived(@NonNull final RemoteMessage message) Called when a push notification is received from Firebase. For more information, see the method description FirebaseMessagingService.onMessageReceived. |
void | onNewToken(@NonNull String token) Called when the system generates a new push token. For more information, see the FirebaseMessagingService.onNewToken(String token) method description. |
void | processPush(@NonNull final Context context, @NonNull final RemoteMessage message) Sends information about push notification to AppMetrica Push SDK. AppMetrica automatically recognizes own messages and processes only them. |
void | processPush(@NonNull final Context context, @NonNull final Bundle data) Sends information about push notification to AppMetrica Push SDK. AppMetrica automatically recognizes own messages and processes only them. |
Method descriptions
onMessageReceived
public void onMessageReceived(@NonNull final RemoteMessage message)
Called when a push notification is received from Firebase. For more information, see the method description FirebaseMessagingService.onMessageReceived.
message | The instance of RemoteMessage. |
message | The instance of RemoteMessage. |
onNewToken
public void onNewToken(@NonNull String token)
Called when the system generates a new push token. For more information, see the FirebaseMessagingService.onNewToken(String token) method description.
token | Token used for sending push notifications. |
token | Token used for sending push notifications. |
processPush
public void processPush(@NonNull final Context context, @NonNull final RemoteMessage message)
Sends information about push notification to AppMetrica Push SDK. AppMetrica automatically recognizes own messages and processes only them.
This method must be called when you simultaneously use AppMetrica Push SDK and Firebase Cloud Messaging.
context | The instance of the Context class. |
message | The instance of RemoteMessage. |
context | The instance of the Context class. |
message | The instance of RemoteMessage. |
processPush
public void processPush(@NonNull final Context context, @NonNull final Bundle data)
Sends information about push notification to AppMetrica Push SDK. AppMetrica automatically recognizes own messages and processes only them.
- When you use simultaneously AppMetrica Push SDK and Firebase Cloud Messaging;
- If you need to change push notification data. If you don't need to change data, use the method processPush(@NonNull final Context context, @NonNull final RemoteMessage message).
context | The instance of the Context class. |
message | The instance of the |
context | The instance of the Context class. |
message | The instance of the |