Marketing Cloud SDK / com.salesforce.marketingcloud.messages.push / PushMessageManager

PushMessageManager

abstract class PushMessageManager

Types

PushTokenRefreshListener

interface PushTokenRefreshListener

SilentPushListener

interface SilentPushListener

Constructors

<init>

PushMessageManager()

Functions

disablePush

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

abstract fun disablePush(): Unit

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 NotificationManager#areNotificationsEnabled().

abstract fun enablePush(): Unit

getPushDebugInfo

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

abstract fun getPushDebugInfo(): JSONObject

getPushToken

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

abstract fun getPushToken(): String?

handleMessage

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

abstract fun handleMessage(pushData: MutableMap<String!, String!>): Boolean

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

abstract fun handleMessage(message: RemoteMessage): Boolean

isMarketingCloudPush

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

open static fun isMarketingCloudPush(pushData: MutableMap<String!, String!>): Boolean

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

open static fun isMarketingCloudPush(message: RemoteMessage): Boolean

isPushEnabled

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

abstract fun isPushEnabled(): Boolean

registerSilentPushListener

Registers the provided listener.

abstract fun registerSilentPushListener(listener: SilentPushListener): Unit

registerTokenRefreshListener

Registers the provided listener.

abstract fun registerTokenRefreshListener(listener: PushTokenRefreshListener): Unit

setPushToken

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.

abstract fun setPushToken(pushToken: String): Unit

unregisterSilentPushListener

Unregisters the provided listener.

abstract fun unregisterSilentPushListener(listener: SilentPushListener): Unit

unregisterTokenRefreshListener

Unregisters the provided listener.

abstract fun unregisterTokenRefreshListener(listener: PushTokenRefreshListener): Unit