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 an 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:
import { Netmera, NetmeraInboxFilter } from 'react-native-netmera';
const netmeraInboxFilter = new NetmeraInboxFilter();
// Filter to show Read or Unread notifications
netmeraInboxFilter.status = Netmera.PUSH_OBJECT_STATUS_READ_OR_UNREAD;
netmeraInboxFilter.pageSize = 10;
netmeraInboxFilter.categories = ["category_1", "category_2"];
netmeraInboxFilter.includeExpiredObjects = true;Fetching the First Page
Use fetchInbox to retrieve notifications that match the filter:
Fetching Next Pages
Once the first page is retrieved, use fetchNextPage to get additional pages:
Updating Push Notification Status
Notifications can have three states:
Unread (PUSH_OBJECT_STATUS_UNREAD)
Read (PUSH_OBJECT_STATUS_READ)
Deleted (PUSH_OBJECT_STATUS_DELETED)
Use inboxUpdateStatus to change a notification's status asynchronously:
Updating The Status of All Notifications
You can update the status of all pushes inside inbox using updateAll method.
Counting Notifications by Status
Retrieve the count of notifications by status:
Inbox Examples
Last updated
Was this helpful?