PushFeature
PushFeatureInitializationStatus
WhenReadyHandler
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
Type: class
Implements: ModuleInterface
Main class for the Push Feature Module.
This class provides comprehensive functionality for push notifications and related features within the Salesforce Marketing Cloud SDK.
Key Features:
Initialization Pattern:
Thread Safety: This class is thread-safe and uses atomic operations for state management. All public methods can be called from any thread.
Since: 1.0.0
1// Initialize PushFeature module
2PushFeature.init(context, config, sdkComponents) { status ->
3 if (status.isUsable) {
4 val pushFeature = PushFeature.getInstance()
5 val pushMessageManager = pushFeature.getPushMessageManager()
6 // Register for token refresh events
7 pushMessageManager.registerTokenRefreshListener { token ->
8 // Handle new token
9 }
10 }
11}object Companion
1open override val state: JSONObjectReturns the current state of the PushFeature module as a JSONObject.
1fun getConfig(): PushFeatureConfigGets the configuration used to initialize this PushFeature instance.
Returns: The PushFeatureConfig instance
1fun getInitializationStatus(): PushFeatureInitializationStatus?Gets the initialization status of this PushFeature instance.
Returns: The initialization status or null if not initialized
1fun getNotificationManager(): NotificationManagerGets the NotificationManager instance for notification operations.
Returns: The NotificationManager instance
1fun getPushMessageManager(): PushMessageManagerGets the PushMessageManager instance for push notification operations.
Returns: The PushMessageManager instance
1fun isTornDown(): BooleanChecks if the PushFeature instance is torn down.
Returns: true if torn down, false otherwise