Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

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

OptionRequiredTypeDescription
inputtrue
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.
  • serviceexceptions - 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

OptionRequiredTypeDescription
inputtrue
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.

notifyMessageInteraction

Notifies the respective listener of the specified type with the message given.

Parameters

OptionRequiredTypeDescription
inputtrue
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.

onMessageActionTaken

Registers a callback that will be invoked on messageActionTaken events.

Parameters

OptionRequiredTypeDescription
inputtrue
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.

Returns

Output type for OnMessageActionTaken API.

onMessageDismissed

Registers a callback that will be invoked on messageDismissed events.

Parameters

OptionRequiredTypeDescription
inputtrue
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.

Returns

Output type for OnMessageDismissed API.

onMessageDisplayed

Registers a callback that will be invoked on messageDisplayed events.

Parameters

OptionRequiredTypeDescription
inputtrue
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.

Returns

Output type for OnMessageDisplayed API.

onMessageReceived

Registers a callback that will be invoked on messageReceived events.

Parameters

OptionRequiredTypeDescription
inputtrue
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.

Returns

Output type for OnMessageReceived API.

setConflictHandler

Set a conflict handler that will be used to resolve conflicts that may emerge when matching events with synced messages.

Parameters

OptionRequiredTypeDescription
inputtrue
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.

syncMessages

Fetch and persist messages from Pinpoint campaigns. Calling this API is necessary to trigger InApp messages on the device.

Throws

  • serviceexceptions - 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