In this section you will find a series of more advanced functionalities that require a more complex development. We recommend that a developer be in charge of this configuration.
User identification
In order to get notifications from Indigitall's Inbox, the user must identify himself. First you have to initialize the SDK of Indigitall so that it generates our identifier (deviceId) and be able to associate it to the custom ID that you associate to the device.
To perform the registration tasks, these two methods are used:
//User Identification
Indigitall.logIn("YOUR_ID",(device)=>{
//DO SOMETHING
}, (error)=>{
//LOG ERROR
});
Indigitall.logOut(device=>{
//DO SOMETHING
}, (error)=>{
//LOG ERROR
});
Generate authentication token
In this section you will see how to generate a validation token for an application that has configured authentication with webhook. To generate this token, you need to add the JSON with the configuration.
To do this, you will have to add a JSON with the corresponding configuration in each Inbox call.
Main Features
Once the device has been successfully registered, you can start making the Inbox requests. The following characteristics of the Inbox must be taken into account, which are optionally configurable.
Inbox Properties
The Inbox notifications will have the following statuses:
- Sent: the notification has been sent to the client, it has been read or not.
- Click: they have clicked on the notification shown in the Inbox.
- Delete: the Inbox notification has been deleted by the client.
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 the notifications
As explained previously, the following method is used to obtain the notifications:
Indigitall.getInbox({"YOUR_AUTH_CONFIG_MAP:IF_NEED"}, (inbox) => {
//DO SOMETHING
},(error) => {
//LOG IndigitallErrorModel
});
Next page
Once the Inbox request has been started and launched, we can request the following page, which is carried out with the following method:
Indigitall.getNextPage(inbox) => {
//DO SOMETHING
},(error) => {
//LOG IndigitallErrorModel
});
Keep in mind 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 this array to move between the pages without depending on the Inbox calls.
Get the information from a notification
To get the information of a particular notification, you have to make the following call with the sendingId of each notification:
Indigitall.getInfoFromNotificationWithSendingId({sendingId:SENDING_ID}, (inboxNotification) => {
//DO SOMETHING
},(error) => {
//LOG IndigitallErrorModel
});
Edit the status of one or more notifications
To edit the status of one or more notifications at the same time, it is done with the following method in which you must indicate the sendingIds of the notifications to edit and the status to which you want to change:
//To Edit a Notification
Indigitall.modifyStatusFromNotificationWithSendingId({
IndigitallParams.PARAM_SENDING_ID:SENDING_ID,
IndigitallParams.PARAM_STATUS:STATUS
}, (inboxNotification) => {
//DO SOMETHING
},(error) => {
//LOG IndigitallErrorModel
});
//Large-scale Modifications
Indigitall.massiveEditNotificationsWithSendingIdsList({
IndigitallParams.PARAM_SENDING_ID_LIST:[SENDING_IDS],
IndigitallParams.PARAM_STATUS:STATUS
}, () => {
//DO SOMETHING
},(error) => {
//LOG IndigitallErrorModel
});
Notifications status counters
To know the number of notifications that are in the Inbox according to their status, this method is carried out:
Indigitall.getMessageCount({"YOUR_AUTH_CONFIG_MAP_IF_NEED"}, (counters) => {
//DO SOMETHING
},(error) => {
//LOG IndigitallErrorModel
});