InAppMessaging
class InAppMessaging : NSObject
The root object for in-app messaging iOS SDK.
Note: Firebase In-App Messaging depends on using a Firebase Installation ID and token pair to be able to retrieve messages defined for the current app instance. By default, the Firebase In-App Messaging SDK will obtain the ID and token pair on app/SDK startup. In its default configuration the in-app messaging SDK will send some device and client data (linked to the installation ID) to the Firebase backend periodically.
The app can tune the default data collection behavior via certain controls. They are listed in descending order below. If a higher-priority setting exists, lower level settings are ignored.
- Dynamically turning on or off data collection behavior by setting the
automaticDataCollectionEnabled
property on theInAppMessaging
instance to true or false. - Setting
FirebaseInAppMessagingAutomaticDataCollectionEnabled
to false in the app’s plist file. - Disabling data collection via the global Firebase data collection setting.
This class is unavailable on macOS, macOS Catalyst, and watchOS.
-
@fn inAppMessaging @brief Gets the singleton InAppMessaging object constructed from the default Firebase app settings.
Declaration
Swift
class func inAppMessaging() -> InAppMessaging
-
Unavailable
Use +inAppMessaging instead.
Unavailable. Use +inAppMessaging instead.
-
A boolean flag that can be used to suppress messaging display at runtime, initialized to false at app startup. Once set to true, the in-app messaging SDK will stop rendering any new messages until this flag is set back to false.
Declaration
Swift
var messageDisplaySuppressed: Bool { get set }
-
A boolean flag that can be set at runtime to allow or disallow collecting user data on app startup. This property is persisted across app restarts and has higher priority over the
FirebaseInAppMessagingAutomaticDataCollectionEnabled
flag (if present) in your app’sInfo.plist
file.Declaration
Swift
var automaticDataCollectionEnabled: Bool { get set }
-
This is the display component that will be used by InAppMessaging to render messages. If it’s
nil
, InAppMessaging will only perform other non-rendering flows (fetching messages for example). Any custom implementations ofInAppMessagingDisplay
require setting this property in order to take effect.Declaration
Swift
var messageDisplayComponent: any InAppMessagingDisplay { get set }
-
Directly requests an in-app message with the given trigger to be shown.
Declaration
Swift
func triggerEvent(_ eventName: String)
-
This delegate should be set on the app side to receive message lifecycle events.
Declaration
Swift
weak var delegate: (any InAppMessagingDisplayDelegate)? { get set }