PushMessageManager

abstract class PushMessageManager

Abstract 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.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed interface PushStatus

Represents the current state of push enablement, providing detailed information about why push notifications might be disabled.

Link copied to clipboard

Listener interface for push token refresh events.

Link copied to clipboard
fun interface SilentPushListener

Listener interface for silent push messages. Silent push messages are background messages that don't display notifications.

Functions

Link copied to clipboard
abstract fun disablePush()

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

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract fun getPushDebugInfo(): JSONObject

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

Link copied to clipboard

Returns the current state of push messaging enablement with detailed information about why push notifications might be disabled.

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract fun handleMessage(message: RemoteMessage): Boolean

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

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

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

Link copied to clipboard
abstract fun isPushEnabled(): Boolean

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

Link copied to clipboard
Link copied to clipboard
abstract 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.

Link copied to clipboard