InAppMessagingFeature
@objc(SFInAppMessagingFeature)
public final class InAppMessagingFeature : NSObject, SFMCModule
extension InAppMessagingFeature: InAppMessagingFeatureApi
extension InAppMessagingFeature: Subscriber
extension InAppMessagingFeature: InAppMessagingFeatureProtocol
This class is a Swift Interface for SFInAppMessagingFeature
-
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.
Declaration
Swift
@objc public static func requestSdk(_ callback: @escaping (_ inappMessagingFeature: InAppMessagingFeatureApi?) -> Void)Parameters
callbackA callback that will receive the InAppMessaging Feature Module when it’s operational/ready.
-
Sets the delegate responsible for receiving in-app message display lifecycle and user interactions.
Use this method to provide an
InAppMessageEventDelegateimplementation to observe events such as message display, dismissal, or user interaction. Passingnilremoves the currently assigned delegate.Declaration
Swift
public func setEventDelegate(_ delegate: InAppMessageEventDelegate?)Parameters
delegateAn object conforming to
InAppMessageEventDelegate, ornilto clear the existing delegate. -
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.Declaration
Swift
public func showInAppMessage(messageId: String)Parameters
messageIdThe unique identifier of the in-app message to be displayed.
-
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
nilresets the font to the default.Declaration
Swift
public func setInAppMessageFont(name: String?) -> BoolParameters
nameThe PostScript name of the font to use, or
nilto revert to the default system font.Return Value
trueif the font was successfully set; otherwisefalse. -
Sets the delegate responsible for handling URL interactions triggered by in-app messages.
Use this method to provide a custom
URLHandlingDelegateimplementation to control how URLs (e.g., deep links or external links) are processed when a user interacts with an in-app message button action.Declaration
Swift
public func setURLHandlingDelegate(_ delegate: URLHandlingDelegate)Parameters
delegateAn object conforming to
URLHandlingDelegatethat will handle URL actions initiated from in-app messages.
InAppMessagingFeature Class Reference