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()

Allows Cordova Inbox Plugin to immediately remove expired messages from the inbox database

(static) deleteMessageId(inboxMessageId)

Allows Cordova Inbox Plugin to delete a message from the database cache and server.

ParameterTypeDefinition
inboxMessageIdStringA unique identifier for an inbox message

(static) executeInboxAction(action)

Allows Cordova Inbox Plugin to call out to action registry to handle rich message actions.

ParameterTypeDefinition
actionObjectIt 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)

Allows Cordova Inbox Plugin to get the inbox message by providing the inbox message ID.

ParameterTypeDefinition
inboxMessageIdStringA unique identifier for an inbox message
callbackinboxMessageCallbackThe callback that handles the response

(static) fetchInboxMessageViaRichContentId(richContentId, callback)

Allows Cordova Inbox Plugin to retrieve an inbox message by providing a richContentId.

ParameterTypeDefinition
richContentIdStringUnique identifier for rich content
callbackinboxMessageCallbackThe callback that handles the response

(static) readMessageId(inboxMessageId)

Allows Cordova Inbox Plugin to set the read status of a message in the database cache and server.

ParameterTypeDefinition
inboxMessageIdStringUnique identifier for inbox message

(static) setInboxMessagesUpdateCallback(callback)

Allow Cordova Inbox Plugin to respond to changes in the inbox list.

ParameterTypeDefinition
callbackinboxListCallbackThe callback that handles the response

(static) syncInboxMessages()

Allows Cordova Inbox Plugin to initiate a sync with the server. Will execute function registered with setInboxMessagesUpdateCallback when complete.

Type Definitions

inboxListCallback(messages)

ParameterTypeDefinition
messagesArrayMessages in Inbox

InboxMessage

ParameterTypeDefinition
attributionStringCampaign name message was sent with
expirationDateIntegerExpiration of message in seconds since epoch
inboxMessageIdStringUnique identifier for inbox message
isDeletedBooleantrue for message deleted, false for message not deleted
isReadBooleantrue for message read, false for message unread
richContentIdStringUnique identifier for rich content
sendDateIntegerMessage sent date in seconds since epoch
templateStringTemplate name that handles display of this message

inboxMessageCallback(messages)

ParameterTypeDefinition
messagesInboxMessageInbox message content

Related pages