API reference for the Campaign Cordova Inbox plugin
Below are the methods that you can use to manage inbox notifications in the Campaign library for Cordova.
Methods
(static) clearExpiredMessages()
clearExpiredMessages()
Allows Cordova Inbox Plugin to immediately remove expired messages from the inbox database
(static) deleteMessageId(inboxMessageId)
deleteMessageId(inboxMessageId)
Allows Cordova Inbox Plugin to delete a message from the database cache and server.
Parameter | Type | Definition |
---|---|---|
inboxMessageId | String | A unique identifier for an inbox message |
(static) executeInboxAction(action)
executeInboxAction(action)
Allows Cordova Inbox Plugin to call out to action registry to handle rich message actions.
Parameter | Type | Definition |
---|---|---|
action | Object | It is normally in the format {"type": <type>, "value": <value>} , but can be anything that is sent in the "notification-action" or the "category-actions" section of the payload. |
(static) fetchInboxMessageId(inboxMessageId, callback)
fetchInboxMessageId(inboxMessageId, callback)
Allows Cordova Inbox Plugin to get the inbox message by providing the inbox message ID.
Parameter | Type | Definition |
---|---|---|
inboxMessageId | String | A unique identifier for an inbox message |
callback | inboxMessageCallback | The callback that handles the response |
(static) fetchInboxMessageViaRichContentId(richContentId, callback)
fetchInboxMessageViaRichContentId(richContentId, callback)
Allows Cordova Inbox Plugin to retrieve an inbox message by providing a richContentId.
Parameter | Type | Definition |
---|---|---|
richContentId | String | Unique identifier for rich content |
callback | inboxMessageCallback | The callback that handles the response |
(static) readMessageId(inboxMessageId)
readMessageId(inboxMessageId)
Allows Cordova Inbox Plugin to set the read status of a message in the database cache and server.
Parameter | Type | Definition |
---|---|---|
inboxMessageId | String | Unique identifier for inbox message |
(static) setInboxMessagesUpdateCallback(callback)
setInboxMessagesUpdateCallback(callback)
Allow Cordova Inbox Plugin to respond to changes in the inbox list.
Parameter | Type | Definition |
---|---|---|
callback | inboxListCallback | The callback that handles the response |
(static) syncInboxMessages()
syncInboxMessages()
Allows Cordova Inbox Plugin to initiate a sync with the server. Will execute function registered with setInboxMessagesUpdateCallback when complete.
Type Definitions
inboxListCallback(messages)
inboxListCallback(messages)
Parameter | Type | Definition |
---|---|---|
messages | Array | Messages in Inbox |
InboxMessage
InboxMessage
Parameter | Type | Definition |
---|---|---|
attribution | String | Campaign name message was sent with |
expirationDate | Integer | Expiration of message in seconds since epoch |
inboxMessageId | String | Unique identifier for inbox message |
isDeleted | Boolean | true for message deleted, false for message not deleted |
isRead | Boolean | true for message read, false for message unread |
richContentId | String | Unique identifier for rich content |
sendDate | Integer | Message sent date in seconds since epoch |
template | String | Template name that handles display of this message |
inboxMessageCallback(messages)
inboxMessageCallback(messages)
Parameter | Type | Definition |
---|---|---|
messages | InboxMessage | Inbox message content |
Related pages
Updated 1 day ago