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.

 

Starting Android 14, by default the Alarm permission is off, So, you need to ask for explicit Alarm permission if you want to show Timer notifications along with adding the above line in Manifest. Kindly check if the permission is already given or not and accordingly call the below line to get Alarm permission from the customer.

 

Java
startActivity(Intent(ACTION_REQUEST_SCHEDULE_EXACT_ALARM))

 

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>

Previous

Next

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

How can we improve this article?