Android SDK Initialization 4.x.x

Get Workspace ID from the Settings Page Dashboard --> Settings --> App --> General on the MoEngage dashboard and initialize the MoEngage SDK in the Application class's onCreate()

info

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.

Kotlin Java
// this is the instance of the application class and "XXXXXXXXXXX" is the Workspace ID from the dashboard.
val moEngage = new MoEngage.Builder(this, "XXXXXXXXXXX")
MoEInitializer.initialize(appplicationContext, moEngage)

Refer to the API reference doc for a detailed list of possible configurations.

warning

Critical

All the configurations 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.

Previous

Next

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?