Push Inbox
Push Inbox Overview
NetmeraInbox
allows you to access and manage previously sent push notifications in an inbox-style interface. You cannot instantiate NetmeraInbox
directly; instead, you must obtain an instance through the SDK and use it to interact with push notifications.
Filtering Notifications
Create a NetmeraInboxFilter
instance to specify which push notifications to fetch. You can filter by:
Status: Read, Unread, or Deleted.
Categories: Filter by specific categories.
Expired Notifications: Include or exclude expired notifications.
Page Size: Number of notifications to fetch per request.
Here is a sample code to determine filtering options:
Fetching the First Page
Use Netmera.fetchInbox
to retrieve notifications that match the filter:
If successful, onFetchInbox
will return an inbox object containing push notifications. Otherwise, it will return an error object with failure details.
Fetching Next Pages
Once the first page is retrieved, use mInbox.fetchNextPage()
to get additional pages:
Calling fetchNextPage()
when no additional pages exist will trigger an error.
Updating Push Notification Status
Notifications can have three states:
Unread
Read
Deleted
Use updateStatus
to change a notification's status asynchronously:
You can also update the status of all notifications without fetching them:
Counting Notifications by Status
Retrieve the count of notifications by status:
Message Categories
You can create new message categories in Settings > Message Category in the panel.
Retrieving User Category Preferences
This method retrieves a list of category preferences, including the category ID, name, and opt-in status.
To update a user’s category preference, provide the category ID and set
categoryEnabled
totrue
orfalse
.
Last updated
Was this helpful?