Message Center

The default Message Center is provided out of the box to all customers using iOS or Android SDK 7.0.0 or later. It requires little to no integration to get started and supports some basic theming options.

Displaying the Message Center

The Message Center can be displayed any time by calling MessageCenter.getMessageCenter() . MessageCenter.showMessageCenter() . A specific message can be displayed by calling MessageCenter.showMessageCenter(java.lang.String) .

Displaying the Message Center

The Airship SDK will default to showing the provided MessageCenterActivity. A custom show behavior can be accomplished by providing a MessageCenter.OnShowMessageCenterListener listener during takeOff:

  airship.getMessageCenter().setOnShowMessageCenterListener(messageId -> {
            // Show the message center (messageId is optional)
            return true;

Styling the Message Center

The Message Center can be styled by providing a custom style in the application's theme with the attribute messageCenterStyle. The Message Center can be customized with the following attributes:

A drawable for the message item's background
Text appearance style for the message's title
Text appearance style for the message's date
Flag to enable message list icons instead of a checkbox
The default placeholder when using message list icons
Text appearance style for the no message selected text when displaying the Message Center in a tablet view
String to use for the "no message selected" text when displaying the Message Center in a tablet view.
Text appearance style for the empty message list text
String to use for the empty message list text
The message list divider color
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
   <!-- Set the custom Message Center style -->
   <item name="messageCenterStyle">@style/AppTheme.MessageCenter</item>

 <style name="AppTheme.MessageCenter" parent="MessageCenter">
     <item name="messageCenterDividerColor">#44000000</item>
     <item name="messageCenterItemIconEnabled">true</item>
     <item name="messageCenterItemTitleTextAppearance">@style/AppTheme.MessageCenter.TitleTextAppearance</item>
     <item name="messageCenterItemDateTextAppearance">@style/AppTheme.MessageCenter.DateTextAppearance</item>

 <!-- Custom message title text style -->
 <style name="AppTheme.MessageCenter.TitleTextAppearance" parent="MessageCenter.Item.Title.TextAppearance">
     <item name="android:textSize">30sp</item>
     <item name="android:textStyle">italic</item>
     <item name="android:textColor">@android:color/black</item>

 <!-- Custom message date text style -->
 <style name="AppTheme.MessageCenter.DateTextAppearance" parent="MessageCenter.Item.Date.TextAppearance">
     <item name="android:textSize">16sp</item>
     <item name="urbanAirshipFontPath">"fonts/CustomFont.ttf"</item>

Message Center Filtering

Sometimes it can be useful to filter the contents of the message center according to some predetermined pattern. To facilitate this, use the shared MessageCenter instance to set a predicate. Once set, only messages that match the predicate will be displayed.

Filtering messages
RichPushInbox.Predicate pred = new RichPushInbox.Predicate() {
    public boolean apply(RichPushMessage message) {
        return message.getTitle().contains("Cool");


Embedding the Message Center

The Message Center can be embedded in any FragmentActivity using MessageCenterFragment .

Embedding the MessageCenterFragment in a layout xml
    android:layout_height="match_parent" />
Embedding the MessageCenterFragment using a fragment transaction
MessageCenterFragment fragment = new MessageCenterFragment();
                                   .replace(, fragment, "message_center")