Customizations
By default, the Actito SDK automatically handles most of the complexity around remote notifications on Android.
However, you may want finer control over how these mechanisms integrate with your app’s architecture and notification strategy. This page explains the advanced configuration options available for remote notifications, how to disable specific SDK behaviors, and how to provide your own custom implementations.
The customizations offered in our library are part of the native SDKs. For more information on what customizations are available, please take a look at the native customization guides.
Android Customizations
Notification channels
Starting in Android 8 (Oreo), in order for your app to display notifications, you need to create channels. Without a channel, notifications will never appear in the notification manager. By default, the SDK creates a single channel named “Push Notifications”.
You can change the name and description of this default channel by adding the following entries to your app/res/strings.xml file:
<string name="actito_default_channel_name">Push Notifications</string>
<string name="actito_default_channel_description">This channel shows push notifications</string>
If you want to use your own notification channel as the default, first create it in your app, then specify its ID in your AndroidManifest.xml:
<meta-data
android:name="com.actito.push.default_channel_id"
android:value="my_custom_channel_id" />
To prevent Actito from automatically creating the default channel altogether, you can disable this behavior by adding the following metadata tag in your AndroidManifest.xml:
<meta-data
android:name="com.actito.push.automatic_default_channel_enabled"
android:value="false" />
Disabling Notification's Auto Cancel
By default, when a user taps a notification, the SDK automatically removes it from the Notification Center. If you prefer to manage this behavior yourself, you can disable auto-cancel by adding the following metadata tag in your AndroidManifest.xml:
<meta-data
android:name="com.actito.push.notification_auto_cancel"
android:value="false" />
Notification Icon Settings
By default, the SDK uses your application icon as the small icon for notifications. You can customize this by specifying a custom drawable resource and accent color in your AndroidManifest.xml:
<meta-data
android:name="com.actito.push.notification_small_icon"
android:resource="@drawable/ic_rocket_black_24dp" />
<meta-data
android:name="com.actito.push.notification_accent_color"
android:resource="@color/actito_blue" />
Notification LED Settings
Some devices display a notification light (LED) when a notification arrives. You can control the color and blink pattern either per-notification (via the Actito REST API or Dashboard) or by defining default values in your AndroidManifest.xml.
<meta-data
android:name="com.actito.push.notification_lights_color"
android:value="red" />
<meta-data
android:name="com.actito.push.notification_lights_on"
android:value="1000" />
<meta-data
android:name="com.actito.push.notification_lights_off"
android:value="2000" />
If neither are set, the SDK defaults to white, blinking 500 ms on / 1500 ms off.
Notifications UI
When your app defines Android themes, you can also customize the visual appearance of Actito notifications by applying your own theme. This allows you to ensure consistent branding and appearance when presenting push notifications.
Themes are declared in a style resource file within your app’s res/values folder. You can then assign your custom theme to Actito’s NotificationActivity in your AndroidManifest.xml:
<activity
android:name="com.actito.push.ui.NotificationActivity"
android:theme="@style/Theme.App.Custom.Translucent" />
You can learn more about theming in the official Android developer guide.
When theming the NotificationActivity, we recommend using a transparent background so that Alert notifications appear seamlessly over your app’s content:
<style name="Theme.App.Custom.Translucent">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
Show progress indicator
You can control whether the notification activity displays a loading indicator while fetching or rendering notification content by setting the following metadata tag in your ApplicationManifest.xml:
<meta-data
android:name="com.actito.push.ui.show_notification_progress"
android:value="true" />