The input object that holds the event to be dispatched.
A promise that will resolve when the operation is complete.
If an event would trigger multiple messages, the message closest to expiry will be chosen by default. To change this behavior, you can use the setConflictHandler API to provide your own logic for resolving message conflicts.
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.
// Sync message before disptaching an event
await syncMessages();
// Dispatch an event
await dispatchEvent({ name: 'test_event' });
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.