---
schema_version: "1"
id: 8a4171ecf00501ee1df5df3aa3a52b9b9e9a4926bf414061b1ad82c949dad4a4
title: InAppMessagingFeature
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud-mobilepush/engagement_sdk/references/ios-sdk-v11/iam-feature/classes/inappmessagingfeature.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/inappmessagingfeature.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9967d6313203dfd4624267a163b4b4efe9e400228b89f98d1fd3333a296acf73
products:
  - Salesforce Engagement SDK
---
# InAppMessagingFeature

`Class`

This class is a Swift Interface for SFInAppMessagingFeature

## Declaration

```swift
@objc(SFInAppMessagingFeature)
public final class InAppMessagingFeature : NSObject, SFMCModule

@objc
public static func requestSdk(_ callback: @escaping (_ inappMessagingFeature: InAppMessagingFeatureApi?) -> Void)

public func setEventDelegate(_ delegate: InAppMessageEventDelegate?)

public func showInAppMessage(messageId: String)

public func setInAppMessageFont(name: String?) -> Bool

public 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.

```swift
@objc
public 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.

```swift
public 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` .

```swift
public 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.

```swift
public func setInAppMessageFont(name: String?) -> Bool
```

**Returns:** `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.

```swift
public func setURLHandlingDelegate(_ delegate: URLHandlingDelegate)
```

---
