Package com.mparticle.messaging
Class MPMessagingAPI
- java.lang.Object
-
- com.mparticle.messaging.MPMessagingAPI
-
public class MPMessagingAPI extends java.lang.Object
DO 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.String
BROADCAST_NOTIFICATION_RECEIVED
Listen for this broadcast (as an Intent action) to detect when the device received a push.static 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.static java.lang.String
CLOUD_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 void
disablePushNotifications()
Unregister the application for FCM notifications.void
displayPushNotificationByDefault(java.lang.Boolean enabled)
void
enablePushNotifications(java.lang.String senderId)
Register the application for FCM notifications.void
registerPushAnalyticsReceiver(PushAnalyticsReceiver receiver)
Register a custom implementation of PushAnalyticsReceiver, which will provide callbacks when push messages are received.void
unregisterPushAnalyticsReceiver(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
-
-