-jio-start-block-type-2
-jio-style-title
This API is used to initialize all the resources for notification center implementation. This api will also delete the older messages from the database if it exceeds the messageExpiryDays from current datetime.
messageExpiryDays
should be Integer value which denotes the number of days the message must be retained in the database.
JioPush.NotificationCenter.init(messageExpiryDays)
-jio-style-title
This API is used to delete all messages from IndexDB.
Callback
will be called without any return value.
JioPush.NotificationCenter.deleteAllNotifications(()=>{})
-jio-style-title
This API is used to store the message into the IndexDB database.
This API accepts a parameter as a Payload object which should be complete incoming message and callback handler.
This API returns the incoming message object that got stored, total message count and total read count via callback handler. Incase of error, it will return null, total message count and total read count.
JioPush.NotificationCenter.storeNotificationMessage(payload,
({result,totalMessages,readMessages})=>{
// DO ANYTHING
})
-jio-style-title
This API is used to get a message based on the messageId.
This API returns the message object corresponding to the input messageId, total message count and total read count via callback handler. Incase message is not found, It will return [] via callback handler.
JioPush.NotificationCenter.getNotificationMessage(messageid,
({result,totalMessages,readMessages})=>{})
-jio-style-title
This API is used to get all the messages stored in the database for a given input date range.
This API accepts three parameters: startDate
in Date.getTime() format or null, endDate
in Date.getTime() format or null and callback
.
JioPush.NotificationCenter.getAllNotificationMessages(startDate,endDate,
({result,totalMessages,readMessages})=>{
//DO ANYTHING
})
-jio-style-title
This API is used to get all the Read messages stored in the database for a given input date range.
It accepts startDate
and endDate
in Date.getTime()
format or null, and a callback
.
This API returns an array of read message objects, total message count, and total read count via the callback. If startDate
& endDate
both are null, it will return all read messages present in the DB. In case no message is found, it will return [] via the callback handler.
JioPush.NotificationCenter.getAllReadNotificationMessages(startDate, endDate, ({result, totalMessages, readMessages}) => {})
-jio-style-title
This API is used to get all the Unread messages stored in the database for a given input date range.
It accepts startDate
and endDate
in Date.getTime()
format or null, and a callback
.
This API returns an array of unread message objects, total message count, and total read count via the callback. If startDate
& endDate
both are null, it will return all unread messages present in the DB. In case no message is found, it will return [] via the callback handler.
JioPush.NotificationCenter.getAllUnreadNotificationMessages(startDate, endDate, ({result, totalMessages, readMessages}) => {})
-jio-style-title
This API is used to update the message state like changing the message state from read to unread.
It accepts a statusArray
in the format [{messageId:<messageId>, readStatus:<readStatus>}]
and a callback
.
This API returns all message objects present in the DB, total message count, and total read count via the callback handler. In case no message is found, it will return [] via the callback handler.
JioPush.NotificationCenter.updateBulkNotificationMessage(statusArray, ({result, totalMessages, readMessages}) => {})
-jio-style-title
This API is used to update the message state like changing the message state from read to unread.
It accepts messageId
, messageReadStatus
(true/false), and a callback
.
This API returns the message object, total message count, and total read count via the callback handler. In case no message is found, it will return [] via the callback handler.
JioPush.NotificationCenter.updateNotificationMessage(messageid, messageReadStatus, ({result, totalMessages, readMessages}) => {})
-jio-style-title
This API is used to delete messages or a message detail from the database for a given messageId
or messageIds
. It accepts messageId
(either a single id or an array of ids) and a callback
. If messageId
is an array of ids to delete, it returns all message objects remaining in the DB, total message count, and total read count via the callback handler. If messageId
is a single id to delete, it returns the deleted message object, total message count, and total read count via the callback handler. In case no message is found, it will return [] via the callback handler.
JioPush.NotificationCenter.deleteNotificationMessage(messageid, ({result, totalMessages, readMessages}) => {})
-jio-style-title
This API is used to fetch the total and read message count via the callback handler.
It accepts a callback
.
This API returns null, total message count, and total read count via the callback handler.
JioPush.NotificationCenter.getNotificationMessagesCount(({result, totalMessages, readMessages}) => {})
-jio-end-block-type-2