Let us know so we can improve!
InAppMessagingFeature
Class
This class is a Swift Interface for SFInAppMessagingFeature
Declaration
1@objc(SFInAppMessagingFeature)
2public final class InAppMessagingFeature : NSObject, SFMCModule
3
4@objc
5public static func requestSdk(_ callback: @escaping (_ inappMessagingFeature: InAppMessagingFeatureApi?) -> Void)
6
7public func setEventDelegate(_ delegate: InAppMessageEventDelegate?)
8
9public func showInAppMessage(messageId: String)
10
11public func setInAppMessageFont(name: String?) -> Bool
12
13public func setURLHandlingDelegate(_ delegate: URLHandlingDelegate)Request SDK Method
requestSdk(_:)
Requests the InAppMessaging Feature Module when it’s operational and safe to use. The provided callback will be invoked with the InAppMessaging Feature Module when it’s ready. All InAppMessaging feature module-related API calls should be made within this function.
1@objc
2public static func requestSdk(_ callback: @escaping (_ inappMessagingFeature: InAppMessagingFeatureApi?) -> Void)InAppMessaging Methods
setEventDelegate(_:)
Sets the delegate responsible for receiving in-app message display lifecycle and user interactions. Use this method to provide an InAppMessageEventDelegate implementation to observe events such as message display, dismissal, or user interaction. Passing nil removes the currently assigned delegate.
1public func setEventDelegate(_ delegate: InAppMessageEventDelegate?)showInAppMessage(messageId:)
Displays a specific in-app message by its identifier. Use this method to manually trigger the presentation of an in-app message that corresponds to the provided messageId .
1public func showInAppMessage(messageId: String)setInAppMessageFont(name:)
Sets the custom font used for rendering in-app messages. Use this method to configure a global font by name that will be applied to in-app message content. Passing nil resets the font to the default.
1public func setInAppMessageFont(name: String?) -> BoolReturns: true if the font was successfully set; otherwise false .
setURLHandlingDelegate(_:)
Sets the delegate responsible for handling URL interactions triggered by in-app messages. Use this method to provide a custom URLHandlingDelegate implementation to control how URLs (e.g., deep links or external links) are processed when a user interacts with an in-app message button action.
1public func setURLHandlingDelegate(_ delegate: URLHandlingDelegate)Let us know so we can improve!