API Reference
clearMessages
Clear locally cached messages.
Throws
validation:
InAppMessagingValidationErrorCode - Thrown if In App messaging hasn't been initialized.
Returns
Promise<void>
dispatchEvent
Triggers an In-App message to be displayed. Use this after your campaigns have been synced to the device using
syncMessages. Based on the messages synced and the event passed to this API, it triggers the display
of the In-App message that meets the criteria.
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The input object that holds the event to be dispatched. |
Throws
validation:
InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.service
exceptions - Thrown when the underlying Pinpoint service returns an error.
Returns
Promise<void>
identifyUser
Sends information about a user to Pinpoint. Sending user information allows you to associate a user to their user
profile and activities or actions in your application. Activity can be tracked across devices & platforms by using
the same
userId
.Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The input object that conforms to IdentifyUserInput used to construct requests sent to Pinpoint's UpdateEndpoint
API. |
Throws
service:
UpdateEndpointException - Thrown when the underlying Pinpoint service returns an error.validation:
InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.
Returns
Promise<void>
initializeInAppMessaging
Initialize and set up in-app messaging category. This API needs to be called to enable other InAppMessaging APIs.
Returns
void
notifyMessageInteraction
Notifies the respective listener of the specified type with the message given.
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The input object that holds the type and message. |
Throws
validation:
InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.
Returns
void
onMessageActionTaken
Registers a callback that will be invoked on
messageActionTaken
events.Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The input object that holds the callback handler. |
Throws
validation:
InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.
onMessageDismissed
Registers a callback that will be invoked on
messageDismissed
events.Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The input object that holds the callback handler. |
Throws
validation:
InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.
onMessageDisplayed
Registers a callback that will be invoked on
messageDisplayed
events.Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The input object that holds the callback handler. |
Throws
validation:
InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.
onMessageReceived
Registers a callback that will be invoked on
messageReceived
events.Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The input object that holds the callback handler. |
Throws
validation:
InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.
setConflictHandler
Set a conflict handler that will be used to resolve conflicts that may emerge
when matching events with synced messages.
Parameters
Option | Required | Type | Description |
---|---|---|---|
input | true | The input object that holds the conflict handler to be used. |
Throws
validation:
InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.
Returns
void
syncMessages
Fetch and persist messages from Pinpoint campaigns.
Calling this API is necessary to trigger InApp messages on the device.
Throws
service
exceptions - Thrown when the underlying Pinpoint service returns an error.validation:
InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.
Returns
Promise<void>
Link Color Legend
Interface
Reference
Other