Package com.mparticle.messaging
Class MPMessagingAPI
- java.lang.Object
-
- com.mparticle.messaging.MPMessagingAPI
-
public class MPMessagingAPI extends java.lang.ObjectDO NOT DIRECTLY INSTANTIATE THIS CLASS! Utility class to enable and adjust push notification behavior.- See Also:
MParticle.Messaging()
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBROADCAST_NOTIFICATION_RECEIVEDListen for this broadcast (as an Intent action) to detect when the device received a push.static java.lang.StringBROADCAST_NOTIFICATION_TAPPEDListen for this broadcast (as an Intent action) to detect when a user taps a push message in the notification bar of their device.static java.lang.StringCLOUD_MESSAGE_EXTRA
-
Constructor Summary
Constructors Constructor Description MPMessagingAPI(android.content.Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisablePushNotifications()Unregister the application for FCM notifications.voiddisplayPushNotificationByDefault(java.lang.Boolean enabled)voidenablePushNotifications(java.lang.String senderId)Register the application for FCM notifications.voidregisterPushAnalyticsReceiver(PushAnalyticsReceiver receiver)Register a custom implementation of PushAnalyticsReceiver, which will provide callbacks when push messages are received.voidunregisterPushAnalyticsReceiver(PushAnalyticsReceiver receiver)Unregister you custom implementation of PushAnalyticsReceiver.
-
-
-
Field Detail
-
CLOUD_MESSAGE_EXTRA
@NonNull public static final java.lang.String CLOUD_MESSAGE_EXTRA
- See Also:
- Constant Field Values
-
BROADCAST_NOTIFICATION_RECEIVED
@NonNull public static final java.lang.String BROADCAST_NOTIFICATION_RECEIVED
Listen for this broadcast (as an Intent action) to detect when the device received a push. In the received Intent, you will have access to the entire payload of the push notification.- See Also:
- Constant Field Values
-
BROADCAST_NOTIFICATION_TAPPED
@NonNull public static final java.lang.String BROADCAST_NOTIFICATION_TAPPED
Listen for this broadcast (as an Intent action) to detect when a user taps a push message in the notification bar of their device. You may then navigate or otherwise adjust the user experience based on the payload of the push. In the received Intent, you will have access to the entire payload of the push notification.- See Also:
- Constant Field Values
-
-
Method Detail
-
enablePushNotifications
public void enablePushNotifications(@NonNull java.lang.String senderId)Register the application for FCM notifications.- Parameters:
senderId- the SENDER_ID for the application
-
disablePushNotifications
public void disablePushNotifications()
Unregister the application for FCM notifications.
-
displayPushNotificationByDefault
public void displayPushNotificationByDefault(@Nullable java.lang.Boolean enabled)
-
registerPushAnalyticsReceiver
public void registerPushAnalyticsReceiver(@NonNull PushAnalyticsReceiver receiver)Register a custom implementation of PushAnalyticsReceiver, which will provide callbacks when push messages are received.- Parameters:
receiver- the implementation of PushAnalyticsReceiver to be registered- See Also:
PushAnalyticsReceiver
-
unregisterPushAnalyticsReceiver
public void unregisterPushAnalyticsReceiver(@Nullable PushAnalyticsReceiver receiver)Unregister you custom implementation of PushAnalyticsReceiver. If the receiver is not found to have been registered, nothing will happen.- Parameters:
receiver- the previously registered implementation of PushAnalyticsReceiver to be unregistered- See Also:
PushAnalyticsReceiver
-
-