Notifications and Badges Count
The following use cases explain how badge counts are handled within the mobile app and the sequence of API calls.
Use Case 1 - Messages Marked As Read
1. Notifications (e.g., offer messages) are fetched via the Fetch User Notifications API, and the app shows the badge count (number of unread messages).
2. The user opens the mobile app and views messages. Rich text notifications are displayed.
3. The mobile app makes the Mark Read API call for all notifications based on event type.
4. When the Mark Read API is invoked, it includes the comma-separated message IDs.
5. The badge count on the server side resets to 0, and the mobile app stops displaying the badge count.
Event Types
The Mark Read API gets invoked when a user marks messages as read via either of the following:
-
In the mobile app: The value
read_through_appis passed with theevent_typerequest parameter. -
Push notification: The value
app_open_via_pushis passed with theevent_typerequest parameter.
For more information, see Push Notifications.
Use Case 2 - Messages Not Marked As Read
1. A notification (e.g., an offer message) is received, and the mobile app shows the badge count (number of unread messages).
2. The user opens the mobile app but does not view messages, so notifications are not displayed.
3. The mobile app does not make the Mark Read API call for notifications, so it continues to retain and show the badge count.