IntentProvider
PushMessageManager
PushMessagingService
DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Package: com.salesforce.marketingcloud.pushfeature.push
Module: Push Feature Module v2.0.0
1abstract class PushMessageManagerAbstract class for managing push messages in the PushFeature module. Provides APIs for token management, message handling, and push enablement.
This class serves as the public interface for push functionality, similar to the original PushMessageManager in the main SDK.
1constructor()1object Companion1sealed interface PushStatusRepresents the current state of push enablement, providing detailed information about why push notifications might be disabled.
1fun interface PushTokenRefreshListenerListener interface for push token refresh events.
1fun interface SilentPushListenerListener interface for silent push messages. Silent push messages are background messages that don’t display notifications.
1abstract fun enablePush()Enables push messaging in the SDK. Push messaging is on by default. If after enabling push you still don’t see notifications then check the system notification settings.
1abstract fun disablePush()Disables push messaging in the SDK. Calling this will result in no push messages being sent to the device.
1abstract fun isPushEnabled(): BooleanReturns whether or not push messaging is enabled. If false then no push messages will be sent to the device.
Returns: Boolean - True if push messaging is enabled
1abstract fun getPushEnabledState(): PushMessageManager.PushStatusReturns the current state of push messaging enablement with detailed information about why push notifications might be disabled.
Returns: PushMessageManager.PushStatus - Current push status
1abstract fun getPushToken(): String?Returns the push token used to push. This is either the value retrieved by the SDK or the one provided in setPushToken.
Returns: String? - The push token, or null if not available
1abstract fun setPushToken(pushToken: String)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: String - The push token from Google1abstract fun handleMessage(message: RemoteMessage): BooleanHandles the remote message payload for any message sent from the Marketing Cloud.
Parameters:
message: RemoteMessage - The remote message to handleReturns: Boolean - True if the message was handled
1abstract fun handleMessage(pushData: Map<String, String>): BooleanHandles the push message payload for any message sent from the Marketing Cloud.
Parameters:
pushData: Map<String, String> - The push message dataReturns: Boolean - True if the message was handled
1abstract fun getPushDebugInfo(): JSONObjectReturns information that can help investigate push message issues. Please be sure to provide this information when submitting a request for support.
Returns: JSONObject - Debug information as JSON
1abstract fun registerTokenRefreshListener(listener: PushMessageManager.PushTokenRefreshListener)Registers the provided PushTokenRefreshListener.
Parameters:
listener: PushMessageManager.PushTokenRefreshListener - The listener to register1abstract fun unregisterTokenRefreshListener(listener: PushMessageManager.PushTokenRefreshListener)Unregisters the provided PushTokenRefreshListener.
Parameters:
listener: PushMessageManager.PushTokenRefreshListener - The listener to unregister1abstract fun registerSilentPushListener(listener: PushMessageManager.SilentPushListener)Registers the provided SilentPushListener.
Parameters:
listener: PushMessageManager.SilentPushListener - The listener to register1abstract fun unregisterSilentPushListener(listener: PushMessageManager.SilentPushListener)Unregisters the provided SilentPushListener.
Parameters:
listener: PushMessageManager.SilentPushListener - The listener to unregister