Push Templates

SDK Installation

Installing using Catalog

Integration using a Version Catalog is the recommended way of integration; refer to the Configure Version Catalog document to configure a catalog if not done already. Once you have configured the catalog add the dependency in the app/build.gradle file as shown below

build.gradle
dependencies {
     ...
    implementation(moengage.richNotification)
}

Alternatively, you can add the dependency using Artifact ID as described in Installation using Artifact ID. However, installation using Catalog ID is the recommended approach as installing using Artifact ID may lead to version mismatch if mapped incorrectly. 

Timer with Progress Bar

Android 12 Support

The SDK uses Alarms to periodically update the progress in the progress bar. Starting Android 12 to use exact alarms, additional permission is required; refer to the documentation for more details. To support the Timer with Progress Bar template on Android 12 and above devices, add the below permission in your manifest file.

AndroidManifest.xml
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>

If the application does not have the above permission Time with Progress Bar notification will not be shown to the user, the backup notification will be shown instead.

Customization

The SDK defines the default color values for the progress bar's background and progress color. These can be customized to suit the application's theme by overriding the values for the below SDK-defined color attributes.

To set the custom color in light and dark mode, override the values in res/values/colors.xml and res/values-night/colors.xml, respectively.

colors.xml
<color name="moe_rich_push_progress_bar_background_color">[YOUR_COLOR]</color>
<color name="moe_rich_push_progress_bar_progress_color">[YOUR_COLOR]</color>
Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?