• Registers a callback that will be invoked on messageDisplayed events.

    Parameters

    Returns OnMessageDisplayedOutput

    • An object that holds a remove method to stop listening to events.

    Throws

    validation: InAppMessagingValidationErrorCode - Thrown when the provided parameters or library configuration is incorrect, or if In App messaging hasn't been initialized.

    Example

    onMessageDisplayed((message) => {
    // use the message
    console.log(message.id);
    });