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 describes the advanced configuration options available for push notifications, including how to override default SDK behaviors and customize their appearance.
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
You can 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" />
Notification Toasts
When executing actions from a notification, you can decide to display toasts messages by setting the following metadata tag in your ApplicationManifest.xml:
<meta-data
android:name="com.actito.push.ui.show_notification_toasts"
android:value="true" />
This can be particularly useful during development or debugging, when you want to confirm that notification actions are being triggered.
Custom Query Parameters
When presenting Webpage or HTML markup notifications, you can include links with query parameters to trigger in-app actions.
Custom close query parameter
By default, the SDK looks for the notificareCloseWindow query parameter to dismiss the notification. If you’d like to use a different parameter name, you can customize it by adding the following metadata tag to your ApplicationManifext.xml:
<meta-data
android:name="com.actito.push.ui.close_window_query_parameter"
android:value="customCloseParam" />
Open action query parameter
By default, the SDK looks for the notificareOpenAction query parameter to open a specific action. If you’d like to use a different parameter name, you can customize it by adding the following metadata tag to your ApplicationManifext.xml:
<meta-data
android:name="com.actito.push.ui.open_action_query_parameter"
android:value="customOpenActionParam" />
Open actions query parameter
By default, the SDK looks for the notificareOpenActions query parameter to open the actions menu. If you’d like to use a different parameter name, you can customize it by adding the following metadata tag to your ApplicationManifext.xml:
<meta-data
android:name="com.actito.push.ui.open_actions_query_parameter"
android:value="customOpenActionsParam" />
In-app Browser Personalization
When presenting In-app browser notification, you can personalize different aspects of the created browser.
Show custom tabs title
You can control whether the in-app browser displays the page title in the toolbar by setting the following metadata tag in your ApplicationManifest.xml:
<meta-data
android:name="com.actito.push.ui.custom_tabs_show_title"
android:value="true" />
Custom Tabs Color Scheme
You can control the color scheme (light or dark mode) of the in-app browser by setting the following metadata tag in your AndroidManifest.xml:
<meta-data
android:name="com.actito.push.ui.custom_tabs_color_scheme"
android:value="light" />
Supported values:
- light — Forces the light mode color scheme.
- dark — Forces the dark mode color scheme.
Any other or missing value defaults to the system color scheme.
Toolbar Color
You can customize the toolbar color of the in-app browser by setting the following metadata tag in your ApplicationManifest.xml:
<meta-data
android:name="com.actito.push.ui.custom_tabs_toolbar_color"
android:resource="@color/custom_toolbar_color" />
Navigation Bar Color
You can customize the navigation bar color of the in-app browser by setting the following metadata tag in your ApplicationManifest.xml:
<meta-data
android:name="com.actito.push.ui.custom_tabs_navigation_bar_color"
android:resource="@color/custom_navigation_bar_color" />
Navigation Bar Divider Color
You can customize the navigation bar divider color of the in-app browser by setting the following metadata tag in your ApplicationManifest.xml:
<meta-data
android:name="com.actito.push.ui.custom_tabs_navigation_bar_divider_color"
android:resource="@color/custom_navigation_bar_divider_color" />
Action Labels
Labels used for Action Buttons in both the Notification Manager and Notification Dialogs can be localized by adding them as strings resources, where the name is equal to the label. To protect collision of resource names, they can be prefixed with a string. The prefix must then be set by using the options in the AndroidManifest.xml.
<meta-data
android:name="com.actito.action_label_prefix"
android:value="custom_prefix" />
Localizable Texts
Our library ships with support for multiple languages that can be customized. To do so, you just have to place translation keys and values in res/values/strings.xml(default) and provide translated versions in res/values-<locale>/strings.xml (for example res/values-fr/strings.xml for French).
You can find all the available translation keys here.