PushFeature
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:
- Firebase Cloud Messaging (FCM) integration
- Push token management and refresh
- Push notification enablement/disablement
- Silent push message handling
- Job scheduling for background operations
- State management and debugging capabilities
Initialization Pattern:
- Singleton pattern with thread-safe initialization
- State management and lifecycle handling
- Component-based architecture
- Proper error handling and logging
- Asynchronous initialization with completion callbacks
Thread Safety: This class is thread-safe and uses atomic operations for state management. All public methods can be called from any thread.
Example Usage:
// Initialize PushFeature module
PushFeature.init(context, config, sdkComponents) { status ->
if (status.isUsable) {
val pushFeature = PushFeature.getInstance()
val pushMessageManager = pushFeature.getPushMessageManager()
// Register for token refresh events
pushMessageManager.registerTokenRefreshListener { token ->
// Handle new token
}
}
}Content copied to clipboard
Since
1.0.0
See also
Properties
Functions
Link copied to clipboard
Gets the configuration used to initialize this PushFeature instance.
Link copied to clipboard
Gets the initialization status of this PushFeature instance.
Link copied to clipboard
Gets the NotificationManager instance for notification operations.
Link copied to clipboard
Gets the PushMessageManager instance for push notification operations.
Link copied to clipboard
Checks if the PushFeature instance is torn down.