All Collections
General
How can I customize my notification center?
How can I customize my notification center?

Find out how you can display advanced content, set expiration dates, sort notifications into categories in your notification center (inbox).

Selma avatar
Written by Selma
Updated over a week ago

Batch's Inbox feature allows you to retrieve the history of push notifications sent to a user through your mobile apps to display them in a dedicated section of the app (e.g. your message center). This can be interesting if you want to:

  • Extend the life of your notifications: as opposed to the device notification center where notifications disappear as soon as they're opened.

  • Allow your users to find important information in the app.

  • Encourage your users to return to the application: by displaying an unread notifications badge on your app's logo for example (see details in the "Filters & display options" below).

  • Enlarge your reach: by displaying notifications to users who are unsubscribed to push notifications (see details in the "Targeting" section below).

For more information on the technical implementation of this feature please check iOS / Android.

Note: Batch does not provide UI components to build a mobile notification center.

The sections below address common use cases that you might want to implement in your notification center (feasibility, implementation steps, recommendations, etc).

A. Content

This section addresses questions related to the type of content that can be retrieved and displayed in the notification center.

Please note that the provided inbox history is retrieved in real-time by Batch's mobile SDK and includes information such as each notification's: title, body, deeplink, media attachment, delivery date, type, custom payload, etc.

Can I display the image/video that was attached to my push campaign in the notification center?

Yes: The media URL (image, video) that has been set up in the push campaign is provided by default in the push notification content retrieved via Batch's Inbox feature. You can use this URL to load and display the image/video within the user's notification center.

Are In-App messages also available in the notification center?

Batch's Inbox only includes the user's Push notification history. Therefore:

  • You will be able to retrieve and display Mobile Landings that are attached to your push campaigns. (See technical documentation here: iOS / Android) ✅

  • You will not be able to retrieve the history of In-App messages that were displayed to the user through In-App automations ❌

Can I insert messages in a user's notification center without sending them a push notification?

Yes: Batch's Inbox only includes the user's Push notification history. However, it is possible to send silent push notifications to your users. These notifications will not trigger an alert or be displayed on the user's locked screen but will be retrievable in their notification center.

If you want to insert this type of message in your users' notification center, here is how:

A: Campaign edition

Silent push notifications on iOS are only available via Batch's push APIs (Transactional API or Push Campaign API).

You first need to choose custom keys that you will use to specify the content of the notifications. The keys should be added in the "Payload" field of the "Advanced settings" section of your campaign form (must be a valid JSON object) or in the custom_payload parameter of the push API's payload.

→ Case 1: from the dashboard

→ Case 2: via push API

{
"name": "New offer",
"live": true,
"push_time": "now",
"targeting": {
"segments": [
"ENGAGED"
]
},
"messages": [
{
"title": "Get ready for the summer 😎",
"body": "Get up to 50% off in our summer sale and..."
}
],
"custom_payload": "{ \"inbox_title\": \"{BATCH:TITLE}\", \"inbox_body\": \"{BATCH:BODY}\", \"inbox_deeplink\": \"{BATCH:DEEPLINK}\"}"
}

💡 As shown above, you can use Batch variables (e.g. {BATCH:TITLE}) to replicate the content in the campaign form's main fields.

B: Technical implementation

Once the custom keys are chosen, they should be shared with the mobile developers so that notification content is retrieved accordingly:

  • The Inbox's silent notification filter must be disabled for silent notifications to be included in the user's notification history (iOS / Android)

  • The notification's isSilent flag should be used to distinguish silent from non-silent notifications

  • Non-silent notification content (title, body, deeplink, etc) will be available in the native dedicated fields of the notification payload

  • Silent notification content will be available through the custom keys in the notification payload (Raw payload object)


B. Targeting

This section addresses questions related to which users can see content in their notification center.

Is the notification center available for logged-in users only?

No: Batch's Inbox feature can be set up in one of two modes:

  • User mode: allows you to retrieve the history of notifications sent to a user once they're logged in to an account in the app. In this case, the inbox content will be the same on all devices on which the user is logged in.

  • Installation mode: allows you to retrieve the history of notifications sent to a given installation. In this case, the inbox content only includes notifications sent to the device and is reset when the application is uninstalled.

Does the user need to be subscribed to the app's push notifications to see messages in their Inbox?

No: The notification center will include all notifications you attempt to send to a user via Batch. As long as the user is not excluded by the targeting of your campaign or automation, they will find the notification in their Inbox.

Note that Batch attempts to send notifications to all users that have a push token independently of their opt-in status.

→ On Android: all users in your Batch userbase have a push token by default.

→ On iOS: you need to make sure to set up iOS's background refresh on your app for all your users to have a push token. Otherwise, only those who have accepted your notifications at least once will have one. This will maximize the number of opt-out users who can have messages in their inbox.


C. Filters & display options

This section addresses questions on user experience optimization through rearranging and filtering content in the notification center.

How long does the message remain in the notification center? Can I define a custom expiration time?

All notifications are kept for a maximum duration of 90 days in Batch's inbox.

If you want to define a shorter custom duration or an expiration date for certain notifications, here is how:

A. Custom lifespan

This is useful if you want to associate a duration after which the notification should no longer be displayed in the notification center (e.g. number of hours, days, weeks, etc).

To achieve that, you will need to choose a custom key that you will be adding to the campaigns for which you want to define a lifespan. The key should be added in the "Payload" field of the "Advanced settings" section of your campaign form (must be a valid JSON object).

⚙️ Needed technical implementation

Once the custom key is chosen, it should be shared with the mobile developers so that notifications are filtered before being displayed:

  • The custom key will be available in the notification payload provided by the inbox (Raw payload object)

  • A filter should be applied based on the custom duration and the Send timestamp, also available in the notification payload

  • It is important that a default behavior is defined for notifications that do not include this custom key

B. Expiration date

This is useful if you want to associate a date after which the notification should no longer be displayed in the notification center (e.g. 01-02-2024).

To achieve that, you will need to choose a custom key that you will be adding to the campaigns for which you want to define an expiration date. The key should be added in the "Payload" field of the "Advanced settings" section of your campaign form (must be a valid JSON object).

⚙️ Needed technical implementation

Once the custom key is chosen, it should be shared with the mobile developers so that notifications are filtered before being displayed:

  • The custom key will be available in the notification payload provided by the inbox (Raw payload object)

  • A filter should be applied by comparing the expiration date to the current date

  • It is important that a default behavior is defined for notifications that do not include this custom key

Note: instead of filtering out a notification, you can also choose to display it differently.

Can I display an unread notifications count inside my mobile app? Can I display a badge outside the app?

Yes: Both are possible.

A. On the app icon

To display an unread notifications badge on your app icon, please check this dedicated article: How can I add a notification badge to my app icon?

This is recommended if you have a notification center as it allows you to encourage users to return to the app to check unread notifications.

B. Inside the app

You can display an unread notifications count inside your app based on the Read state provided for each notification. To optimize the user experience, we advise you only take into consideration the last-fetched page of notifications (See technical documentation: iOS / Android). This prevents generating user frustration with high unread counters that cannot be reset.

Make sure you cache fetched notifications to avoid reloading the notification history at each app open.

Can I group notifications by period of time (e.g. group notification per month, week, etc)?

Yes: A send timestamp is provided by default in the push notification content retrieved via Batch's Inbox feature. Based on this date, you can group notifications in your UI by period.

Can I sort messages into different categories within the notification center?

Yes: You can attach a category to each campaign at creation and use this information to sort notifications by category in the user's notification center.

To do so, you will need to choose a custom key that you will be adding to your campaigns to attach a category. The key should be added in the "Payload" field of the "Advanced settings" section of your campaign form (must be a valid JSON object).

⚙️ Needed technical implementation

Once the custom key is chosen, it should be shared with the mobile developers along with all the possible category values so that notifications can be displayed accordingly:

  • The custom key will be available in the notification payload provided by the inbox (Raw payload object)

  • It is important that a default behavior is defined for notifications that do not include this custom key (e.g. an "All notifications" section)

Can I filter out certain messages from the notification center?

Yes: You can specify whether or not a campaign should be displayed in the user's notification center at creation.

To do so, you will need to choose a custom key that you will be adding to your campaigns to specify if they should be included in the notification center. The key should be added in the "Payload" field of the "Advanced settings" section of your campaign form (must be a valid JSON object).

⚙️ Needed technical implementation

Once the custom key is chosen, it should be shared with the mobile developers so that notifications are filtered before being displayed:

  • The custom key will be available in the notification payload provided by the inbox (Raw payload object)

  • It is important that a default behavior is defined for notifications that do not include this custom key


D. User interactions

This section addresses questions related to user interactions within the notification center.

Does Batch track clicks and displays in the notification center?

No: Batch's Inbox feature only provides a history of notification data. This data is then displayed in your mobile apps within a UI that you manage. Therefore, any interactions with these screens should be tracked on your end.

Is it possible for the user to delete a notification or to mark one as read in the notification center?

Yes: Batch provides native SDK methods allowing you to mark a notification as Read or Deleted based on a user action (See technical documentation: iOS / Android).

Note: Push notifications that have been clicked by the user outside the app will automatically be marked as read.

Is it possible to redirect the user inside or outside the app when they click on a notification in their inbox?

Yes: The Deeplink or redirection URL that has been set up in the push campaign is provided by default in the push notification content retrieved via Batch's Inbox feature. For notifications that have a deeplink attached, a redirection can be triggered when clicked by the user.

Please note that this redirection needs to be managed by the app independently of Batch's SDK.

Did this answer your question?