Follow these steps to integrate MoEngage on Android:
Install using BOM
Use the Bill of Materials (BOM) to automatically manage compatible versions of the SDK modules.
dependencies {
...
// Import the MoEngage BOM
implementation(platform("com.moengage:android-bom:<bomVersion>"))
// Add optional modules as needed
implementation("com.moengage:inapp")
}Replace <bomVersion> with the latest BOM version. For more info on integration using BOM, refer here.
Add Androidx Libraries
The SDK depends on a few Androidx libraries for its functioning, add the below Androidx libraries in your application if not done already.
implementation("androidx.core:core:1.9.0")
implementation("androidx.appcompat:appcompat:1.4.2")
implementation("androidx.lifecycle:lifecycle-process:2.7.0")The MoEngage SDK depends on the lifecycle-process library for a few key features to work and the latest version of lifecycle-process depends on the androidx.startup:startup-runtime library. Hence do not remove the InitializationProvider component from the manifest. When adding other Initializers using the startup-runtime make sure the Initializer for lifecycle-process library is also added. Refer to the documentation to know how to add the Initializer.