public abstract class

PushMessageManager

extends Object
java.lang.Object
   ↳ com.salesforce.marketingcloud.messages.push.PushMessageManager

Summary

Nested Classes
interface PushMessageManager.PushTokenRefreshListener  
interface PushMessageManager.SilentPushListener  
Public Constructors
PushMessageManager()
Public Methods
abstract void disablePush()
Disables push messaging in the SDK.
abstract void enablePush()
Enabled push messaging in the SDK.
abstract JSONObject getPushDebugInfo()
Returns information that can help investigate push message issues.
abstract String getPushToken()
Returns the push token used to push.
abstract boolean handleMessage(Map<String, String> pushData)
Handles the push message payload for any message sent from the Marketing Cloud.
abstract boolean handleMessage(RemoteMessage message)
Handles the remote message payload for and message sent from the Marketing Cloud.
static boolean isMarketingCloudPush(Map<String, String> pushData)
Helper method to identify a push message payload sent from the Marketing Cloud.
static boolean isMarketingCloudPush(RemoteMessage message)
Helper method to identify a RemoteMessage sent from the Marketing Cloud.
abstract boolean isPushEnabled()
Returns whether or not push messaging is enabled.
abstract void registerSilentPushListener(PushMessageManager.SilentPushListener listener)
Registers the provided listener.
abstract void registerTokenRefreshListener(PushMessageManager.PushTokenRefreshListener listener)
Registers the provided listener.
abstract void setPushToken(String pushToken)
Only call this method if you are handling the request, and refresh of, the push token from Google.
abstract void unregisterSilentPushListener(PushMessageManager.SilentPushListener listener)
Unregisters the provided listener.
abstract void unregisterTokenRefreshListener(PushMessageManager.PushTokenRefreshListener listener)
Unregisters the provided listener.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PushMessageManager ()

Public Methods

public abstract void disablePush ()

Disables push messaging in the SDK. Calling this will result in no push messages being sent to the device.

public abstract void enablePush ()

Enabled push messaging in the SDK. Push messaging is on by default. If after enabling push you still don't see notifications then check areNotificationsEnabled().

public abstract JSONObject getPushDebugInfo ()

Returns information that can help investigate push message issues. Please be sure to provide this information when submitting a request for support.

public abstract String getPushToken ()

Returns the push token used to push. This is either the value retrieved by the SDK or the one provided in setPushToken(String)

public abstract boolean handleMessage (Map<String, String> pushData)

Handles the push message payload for any message sent from the Marketing Cloud.

Parameters
pushData Push message payload
Returns
  • True is the push message was handled by the SDK

public abstract boolean handleMessage (RemoteMessage message)

Handles the remote message payload for and message sent from the Marketing Cloud.

Parameters
message Remote message payload
Returns
  • True if the remote message was handles by the SDK.

public static boolean isMarketingCloudPush (Map<String, String> pushData)

Helper method to identify a push message payload sent from the Marketing Cloud.

Parameters
pushData Push message payload
Returns
  • True if the message was sent from the Marketing Cloud.

public static boolean isMarketingCloudPush (RemoteMessage message)

Helper method to identify a RemoteMessage sent from the Marketing Cloud.

Parameters
message Push message payload
Returns
  • True if the message was sent from the Marketing Cloud.

public abstract boolean isPushEnabled ()

Returns whether or not push messaging is enabled. If false then no push messages will be sent to the device.

public abstract void registerSilentPushListener (PushMessageManager.SilentPushListener listener)

Registers the provided listener.

public abstract void registerTokenRefreshListener (PushMessageManager.PushTokenRefreshListener listener)

Registers the provided listener.

public abstract void setPushToken (String pushToken)

Only call this method if you are handling the request, and refresh of, the push token from Google. Set the push token to be used by the Marketing Cloud to send push messages to the device. The push token is a required value to send a registration payload to the Marketing Cloud so if you fail to set this value you will not see updates to the registration.

Parameters
pushToken The token value to provided by Google.

public abstract void unregisterSilentPushListener (PushMessageManager.SilentPushListener listener)

Unregisters the provided listener.

public abstract void unregisterTokenRefreshListener (PushMessageManager.PushTokenRefreshListener listener)

Unregisters the provided listener.