InAppMessagingDisplayDelegate

protocol InAppMessagingDisplayDelegate : NSObjectProtocol

A protocol defining those callbacks to be triggered by the message display component under appropriate conditions.

  • Called when the message is dismissed. Should be called from main thread.

    Declaration

    Swift

    func messageDismissed(_ inAppMessage: InAppMessagingDisplayMessage, dismissType: FIRInAppMessagingDismissType)

    Parameters

    inAppMessage

    the message that was dismissed.

    dismissType

    specifies how the message is closed.

  • Called when the message’s action button is followed by the user.

    Declaration

    Swift

    func messageClicked(_ inAppMessage: InAppMessagingDisplayMessage)

    Parameters

    inAppMessage

    the message that was clicked.

  • Use this to mark a message as having gone through enough impression so that headless component can make appropriate impression tracking for it.

    Calling this is optional.

    When messageDismissedWithType: or messageClicked is triggered, the message would be marked as having a valid impression implicitly. Use impressionDetected if the UI implementation would like to mark valid impression in additional cases. One example is that the message is displayed for N seconds and then the app is killed by the user. Neither onMessageDismissedWithType or onMessageClicked would be triggered in this case. But if the app regards this as a valid impression and does not want the user to see the same message again, call impressionDetected to mark a valid impression.

    Declaration

    Swift

    func impressionDetected(for inAppMessage: InAppMessagingDisplayMessage)

    Parameters

    inAppMessage

    the message for which an impression was detected.

  • Called when the display component could not render the message due to various reason. It’s essential for display component to call this when error does arise. On seeing this, the headless component of fiam would assume that a prior attempt to render a message has finished and therefore it’s ready to render a new one when conditions are met. Missing this callback in failed rendering attempt would make headless component think a fiam message is still being rendered and therefore suppress any future message rendering.

    Declaration

    Swift

    func displayError(for inAppMessage: InAppMessagingDisplayMessage, error: Error)

    Parameters

    inAppMessage

    the message that encountered a display error.