Initialization

Once the device has been successfully registered, you can start making Inbox requests. The following characteristics of the Inbox must be taken into account, which are optionally configurable.

Properties
The notifications of the Inbox will have the following states of the class InboxStatus:

  • Sent : The notification has been sent to the client, whether or not they could read it.
  • Click: have clicked on the notification displayed in the Inbox.
  • Delete : The Inbox notification has been deleted by the customer.

Each notification will be assigned with an integer and unique sendingId, to be able to differentiate them and use them for some of the functionalities.

Get notifications

As explained above, to obtain the notifications the following method is used:

Inbox.getInbox(inbox=>{
    //DO SOMETHING
},(error)=>{
    //LOG ERROR
});

Next Page

Once the Inbox object has been obtained, we can request the following page, which is made with the following method:

Inbox.getNextPage(inbox=>{
  //DO SOMETHING
},(error)=>{
  //LOG ERROR
});

Take into account that the Inbox callback, apart from returning the updated Inbox, returns an array called newNotifications, in which the new notifications to be added to the Inbox will be displayed, so that, if necessary, be able to use said array to move between the pages without depending on the Inbox calls.