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:
inbox.getInfoFromNotification(context, SENDING_ID , new InboxNotificationsCallback(context) {
@Override
public void onSuccess(InboxNotification inboxNotification) {
//DO SOMETHING
}
});inbox.getInfoFromNotification(context, SENDING_ID, object : InboxNotificationsCallback(context) {
override fun onSuccess(inboxNotification: InboxNotification?) {
// Display notification details
}
})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.
You have InboxStatus to indicate the new status: SENT, CLICK or DELETED.
You can edit status message from an initial state.
//Modify a notification
inbox.modifyStatusFromNotification(context, SENDING_ID, STATUS, new InboxNotificationsCallback(context) {
@Override
public void onSuccess(InboxNotification inboxNotification) {
//DO SOMETHING
}
});
//Massively modify
ArrayList<Integer> sendingIds = new ArrayList<>();
// Add notification sending IDs to sendingIds before calling the API.
inbox.massiveEditNotifications(context, sendingIds, InboxStatus.CLICK, new InboxBaseCallback(context) {
@Override
public void onSuccess() {
//DO SOMETHING
}
@Override
public void onError(Integer errorId, String errorMessage, String descriptionMessage) {
//LOG ERROR
}
});
//Massively modify from initial State
inbox.massiveEditNotificationsWithInitialStatus(
context, sendingIds, InboxStatus.SENT, InboxStatus.CLICK, new InboxBaseCallback(context) {
@Override
public void onSuccess() {
//DO SOMETHING
}
@Override
public void onError(Integer errorId, String errorMessage, String descriptionMessage) {
//LOG ERROR
}
});inbox.modifyStatusFromNotification(context, sendingId, InboxStatus.CLICK,
object : InboxNotificationsCallback(context) {
override fun onSuccess(inboxNotification: InboxNotification?) {
// Notification status updated
}
})
val sendingIds = arrayListOf(sendingId)
inbox.massiveEditNotifications(context, sendingIds, InboxStatus.CLICK,
object : InboxBaseCallback(context) {
override fun onSuccess() {
// Notifications updated
}
override fun onError(errorId: Int?, errorMessage: String?, descriptionMessage: String?) {
// Handle the error
}
})
inbox.massiveEditNotificationsWithInitialStatus(
context, sendingIds, InboxStatus.SENT, InboxStatus.CLICK,
object : InboxBaseCallback(context) {
override fun onSuccess() {}
override fun onError(errorId: Int?, errorMessage: String?, descriptionMessage: String?) {
// Handle the error
}
})