Netmera Developer Guide
Netmera Docs
  • Netmera Developer Guide
  • Platforms
    • iOS
      • New iOS (Swift)
        • SDK Integration
        • Push Notifications
          • Delegate Methods
          • Widget and In-App Messages
          • Media Push
          • Carousel, Slider and Thumbnail Push
        • Deep Linking
          • Custom Deep Links
        • Sound & Vibration
        • Push Inbox
        • Events
        • Geofence & Location
        • User Attributes & Preferences
        • Advertising ID
        • Changelog
      • Former iOS (Objective-C)
        • SDK Integration
        • Push Notifications
          • Delegate Methods
          • Push Payload Receivers
          • Widget and In-App Messages
          • Customizing In-App Messages
          • Media Push
          • Carousel, Slider and Thumbnail Push
          • Custom Web View Presentation
          • Push Icon
        • Live Activities
        • Deep Linking
          • Custom Deep Links
        • Sound & Vibration
        • Push Inbox
        • Events
        • Geofence & Location
        • User Attributes & Preferences
        • Data Transfer
        • Advertising ID
        • SSL Pinning
        • Changelog
    • Android
      • SDK Integration
        • Huawei Integration
        • Huawei Message Receipt
        • Android Integration FAQs
      • Push Notifications
        • Widget and In-App Messages
        • Push Callbacks
        • Custom Web View Presentation
        • Push Icon
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
        • Background Location Permission
      • User & Attributes
      • Data Transfer
      • Advertising ID
      • App Tracking
      • SSL Pinning
      • Changelog
    • Web
      • SDK Setup
        • Self-Hosted SDK Setup
      • Mobile Web Push for iOS
      • Deep Linking
        • Custom Deep Links
      • Events
      • User & Attributes
    • React Native
      • SDK Integration
      • Push Notifications
        • Widget and In-App Messages
        • Push Callbacks
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
      • User & Attributes
      • Changelog
    • Flutter
      • SDK Integration
      • Push Notifications
        • Push Notification Permissions
        • Widget and In-App Messages
        • Flutter iOS Media Push
      • Deep Linking
        • Custom Deep Links
      • Sound & Vibration
      • Push Inbox
      • Events
      • Geofence & Location
      • User & Attributes
      • SSL Pinning
      • Changelog
    • Cordova
      • SDK Integration
      • Push Notifications
      • Sound & Vibration
      • Push Inbox
      • Events
      • User & Attributes
    • Unity
      • SDK Integration
      • Sound & Vibration
      • Events
      • User & Attributes
      • Changelog
  • Integrated Modules
    • Optimove
    • Adjust
    • Mixpanel
    • IYS Integration
    • VIA Integration
      • Short URL Consent Requests
      • OTP Consent Requests
        • OTP Confirmation Completion
      • VIA Email Rejection Link Generation
      • ETK Rejection via SMS
  • API Documentation
    • REST API
      • Setup
      • Notifications
      • Events
      • User & Device Management
      • Inbox Feature
      • GDPR
      • Error Responses
  • FAQs
    • Push Notifications FAQs
Powered by GitBook
On this page
  • Push Inbox Overview
  • Filtering Notifications
  • Fetching the First Page
  • Fetching Next Pages
  • Updating Push Notification Status
  • Counting Notifications by Status

Was this helpful?

  1. Platforms
  2. Cordova

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:

import { Netmera, NetmeraInboxFilter } from 'react-native-netmera'

     const netmeraInboxFilter = new NetmeraInboxFilter()
     //Show Read or Unread notifications
     netmeraInboxFilter.status = NetmeraPushStatus.readAndUnread
     netmeraInboxFilter.pageSize = 10
     netmeraInboxFilter.categories = ["category_1", "category_2"]
     netmeraInboxFilter.includeExpiredObjects = false

Fetching the First Page

Use fetchInboxUsingFilter() to retrieve notifications that match the filter:

fetchInboxUsingFilter() {

   let filter: NetmeraInboxFilter = {
     status: NetmeraPushStatus.readAndUnread,
     pageSize: 20
   }
   this.netmera.fetchInboxUsingFilter(filter).then(inbox => {
     console.log("FetchInbox Success: ");
   }).catch(err => {
     console.log("FetchInbox Error", err);
   });
 }

Fetching Next Pages

Once the first page is retrieved, use netmera.fetchNextPage() to get additional pages:

this.netmera.fetchNextPage().catch(inbox => {
     console.log("FetchNextPage: ");
   }).catch(err => {
     console.log("FetchNextPage error: ",err);
   });

Calling netmera.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:

this.netmera.updatePushStatus(index, length, NetmeraPushStatus.read).then(result => {
      console.log("Update Status: ", result);
    }).catch(err => {
      console.log("Update Error: ", err);
    });

Counting Notifications by Status

Retrieve the count of notifications by status:

//get count unread push objects
    this.netmera.countForStatus(NetmeraPushStatus.unread).then(count => {
      console.log("Count: ", count);
    }).catch(err => {
      console.log(err);
    });
PreviousSound & VibrationNextEvents

Last updated 2 months ago

Was this helpful?