Initialize the SDK

Initialize the SDK during the execution of the onCreate method for your Application class. Initialization requires configuration data for your Marketing Cloud Engagement application.

Before you initialize the SDK, configure your app in Marketing Cloud Engagement and obtain the App ID, Access Token, App Endpoint, and MID values.

For SDK version 10 or higher, use this code.

For version 8 or 9 of the SDK, use SFMCSdk to initialize the MarketingCloudSdk.

If you use version 7 of the SDK, use this code.

To ensure that the SDK can send messages while the app is in the background, call the SDK’s configure method and initialize the pushModuleConfig from your app’s onCreate method.