FirebaseInAppMessaging Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
InAppMessagingDisplayDelegate
protocol InAppMessagingDisplayDelegate : NSObjectProtocol
A protocol defining those callbacks to be triggered by the message display component
under appropriate conditions.
This protocol is unavailable on macOS, macOS Catalyst, and watchOS.
-
Called when the message is dismissed. Should be called from main thread.
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.
Parameters
inAppMessage
|
the message that was clicked.
|
action
|
contains the text and URL for the action 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.
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.
Parameters
inAppMessage
|
the message that encountered a display error.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-04 UTC.
[null,null,["Last updated 2025-08-04 UTC."],[],[],null,["InAppMessagingDisplayDelegate \n\n protocol InAppMessagingDisplayDelegate : NSObjectProtocol\n\nA protocol defining those callbacks to be triggered by the message display component\nunder appropriate conditions.\nThis protocol is unavailable on macOS, macOS Catalyst, and watchOS.\n- `\n ``\n ``\n `\n\n [messageDismissed(_:dismissType:)](#/c:objc(pl)FIRInAppMessagingDisplayDelegate(im)messageDismissed:dismissType:)`\n ` \n Called when the message is dismissed. Should be called from main thread. \n\n Declaration \n Swift \n\n optional func messageDismissed(_ inAppMessage: ../Classes/InAppMessagingDisplayMessage.html, dismissType: ../Enums/InAppMessagingDismissType.html)\n\n Parameters\n\n- `\n ``\n ``\n `\n\n [messageClicked(_:with:)](#/c:objc(pl)FIRInAppMessagingDisplayDelegate(im)messageClicked:withAction:)`\n ` \n Called when the message's action button is followed by the user. \n\n Declaration \n Swift \n\n optional func messageClicked(_ inAppMessage: ../Classes/InAppMessagingDisplayMessage.html, with action: ../Classes/InAppMessagingAction.html)\n\n Parameters\n\n- `\n ``\n ``\n `\n\n [impressionDetected(for:)](#/c:objc(pl)FIRInAppMessagingDisplayDelegate(im)impressionDetectedForMessage:)`\n ` \n Use this to mark a message as having gone through enough impression so that\n headless component can make appropriate impression tracking for it.\n\n Calling this is optional.\n\n When messageDismissedWithType: or messageClicked is\n triggered, the message would be marked as having a valid impression implicitly.\n Use impressionDetected if the UI implementation would like to mark valid\n impression in additional cases. One example is that the message is displayed for\n N seconds and then the app is killed by the user. Neither\n onMessageDismissedWithType or onMessageClicked would be triggered\n in this case. But if the app regards this as a valid impression and does not\n want the user to see the same message again, call impressionDetected to mark\n a valid impression. \n\n Declaration \n Swift \n\n optional func impressionDetected(for inAppMessage: ../Classes/InAppMessagingDisplayMessage.html)\n\n Parameters\n\n- `\n ``\n ``\n `\n\n [displayError(for:error:)](#/c:objc(pl)FIRInAppMessagingDisplayDelegate(im)displayErrorForMessage:error:)`\n ` \n Called when the display component could not render the message due to various reason.\n It's essential for display component to call this when error does arise. On seeing\n this, the headless component of fiam would assume that a prior attempt to render a\n message has finished and therefore it's ready to render a new one when conditions are\n met. Missing this callback in failed rendering attempt would make headless\n component think a fiam message is still being rendered and therefore suppress any\n future message rendering. \n\n Declaration \n Swift \n\n optional func displayError(for inAppMessage: ../Classes/InAppMessagingDisplayMessage.html, error: any Error)\n\n Parameters"]]