Skip to main content
InformationYou can now get notified whenever MoEngage releases a new version of the Android Native SDK. For more information, refer to Subscribe to MoEngage SDK Releases.

Overview

Starting from Android SDK core version 14.04.03 and later, MoEngage recommends using the Bill of Materials (BOM) to integrate the Android SDK. By defining a single BOM version, you ensure that all MoEngage modules, such as Push Kit, Rich Media, and Geofence, automatically use compatible versions. BOM simplifies dependency management, prevents version conflicts, and eliminates the need to manually track version numbers for each individual artifact.

Add the BOM to your application

To integrate the BOM, add the android-bom dependency to the application-level build.gradle file. The version number is specified only in this dependency. V(1)
dependencies {
    // Import the MoEngage BOM
    implementation(platform("com.moengage:android-bom:<bomVersion>"))
}
Replace the <bomVersion> with the relevant version number. For more information on BOM versions, refer to the Android SDK release notes.

Add MoEngage Modules

Once the BOM is configured, include the specific MoEngage modules required for the application.
Note: Version numbers are not required for these dependencies; the BOM automatically manages them.
dependencies {
    // -------------------------------------------------
    // OPTIONAL MODULES (Add based on required features)
    // -------------------------------------------------

    // Cards Core - Required if using Cards Core APIs directly
    implementation("com.moengage:cards-core")
    
    // Cards UI - Required for Cards (feed) UI
    implementation("com.moengage:cards-ui")
    
    // Geofence - Required for Geofence-based campaigns
    implementation("com.moengage:geofence")
    
     // HMS Push Kit - Required for Huawei Push Notifications
    implementation("com.moengage:hms-pushkit")
    
     // InApp - Required for In-App Messaging
    implementation("com.moengage:inapp")
    
     // Inbox Core - Required if using Inbox Core APIs directly
    implementation("com.moengage:inbox-core")
    
     // Inbox UI - Required for Notification Center (Inbox) UI
    implementation("com.moengage:inbox-ui")
    
     // Push Amp - Required for Push Amplification
    implementation("com.moengage:push-amp")
    
    // Real Time Trigger - Required for device-triggered campaigns
    implementation("com.moengage:realtime-trigger")
    
    // Rich Notification - Required for Push Templates 
    implementation("com.moengage:rich-notification")
    
    // Security - Required for Security features, for example; storage encryption
    implementation("com.moengage:security")
}
InfoWhile MoEngage strongly recommends using the BOM for seamless dependency management, you can opt to manually configure versions for each artifact. If you choose this approach, you must ensure that the versions of all integrated modules are compatible with one another.To find the latest versions and compatible artifact combinations, please refer to the Installing SDK using Artifact Id.

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.15.0")
implementation("androidx.appcompat:appcompat:1.7.1")
implementation("androidx.lifecycle:lifecycle-process:2.8.7")
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 ensure the Initializer for lifecycle-process library is also added. Refer to the documentation to know how to add the Initializer.

Impact of using BOM

Using the BOM does not increase the application size. It functions strictly as a version manager to ensure compatibility. Only the specific modules included in the dependencies block (e.g., push-kit, android-sdk) are bundled into the application.

Why use BOM?

  • Simplified Versioning: Eliminates the need to manage individual artifact versions. Updating the BOM version updates the entire integration.
  • Compatibility: The BOM ensures that all integrated modules work efficiently together, preventing runtime crashes caused by mismatched library versions.
  • Cleaner Configuration: Maintains a clean build.gradle file with a single source of truth for the SDK version.