init
fun init(context: Context, config: PushFeatureConfig, sdkComponents: SFMCSdkComponents, listener: InitializationListener? = null)
Initializes the PushFeature module with the provided configuration.
This method follows the same pattern as MarketingCloudSdk.init() and performs the following operations:
- Validates input parameters
- Stores configuration for later use
- Performs thread-safe initialization
- Creates and initializes component instances
- Notifies completion listeners
The initialization process is asynchronous and runs on a background thread. The provided listener will be called when initialization completes, regardless of success or failure.
This method is idempotent - calling it multiple times will only initialize once.
Parameters
context
The application context. Must not be null.
config
The PushFeature configuration containing module settings. Must not be null.
sdkComponents
The SFMC SDK components for job scheduling and logging. Must not be null.
listener
Optional listener to be notified when initialization completes. May be null.
See also
#isInitializing()
Throws
if any required parameter is null