Android SDK Initialisation

SDK Configuration

Get APP ID from the Settings Page Dashboard --> Settings --> App --> General on the MoEngage dashboard and initialize the MoEngage SDK in the Application class's onCreate()
Note: It is recommended that you initialize the SDK on the main thread inside onCreate() and not create a worker thread and initialize the SDK on that thread.

MoEngage.Builder builder = new MoEngage.Builder(this, "XXXXXX");
MoEInitializer.Initialize(builder.Build());

❗️

Note

All the configuration should be added to the builder before calling initialize. If you are calling initialize at multiple places please ensure that all the required flags and configuration are set each time you initialize to maintain consistency in behavior.

Data Redirection

In case your app wants to redirect data to a specific zone due to any data regulation policy please configure the zone in the MoEngage initializer object. Use the RedirectDataToRegion() to set the region.

MoEngage.Builder builder = new MoEngage.Builder(this, "XXXXXX")
  .RedirectDataToRegion(MoEngage.DATA_REGION.RegionEu)
MoEInitializer.Initialize(builder.Build());