Configure the Content Extension for the iOS Extension SDK
To show rich media notifications in your app, add and configure a content extension in your project.
The configuration steps vary depending on your programming language. If you use Swift, click View Swift code example to expand the Swift example. If you use Objective-C, click View Objective-C code example to expand the Objective-C example.
Notification Content Extensions run as separate processes within your app, providing isolation and enhancing security.
- In Xcode, go to File > New > Target.
- From the iOS > Application Extension section, select Notification Content Extension.
- Click Next.
- Provide a name and configure your extension settings.
- Click Finish.
- In the general settings for your target, verify that the Frameworks, Libraries, and Embedded Content section lists the new extension. If it isn’t present, add it.
Integrate the MCExtensionSDK into your Content Extension by using the same process as the Service Extension. For detailed instructions, see Integrate the Extension SDK with the Service Extension.
After you complete the integration, verify that your Content Extension’s target settings list the library in the Frameworks, Libraries, and Embedded Content section.

Remove the provided sample code and inherit the main class of the Content Extension from SFMCNotificationViewController.
View Swift code example
View Objective-C code example
Header file
Implementation file
SFMCNotificationViewController fully manages UI rendering. Don’t implement or override any UIViewController methods in the principal class of the content extension.
Configure your project and content extension’s Info.plist file to register the notification category, build the UI programmatically, and turn on user interaction.
Set up the notification category in your content extension’s Info.plist file to match the category in Marketing Cloud Next.
- Work with your Marketing Admin to obtain the category name for your Rich UI template.
- In your content extension’s
Info.plistfile, set the value forUNNotificationExtensionCategoryunderNSExtension > NSExtensionAttributes.
The MCExtensionSDK builds the notification UI programmatically. Configure your project to build the UI in code.
-
Remove the storyboard reference by deleting the
NSExtensionMainStoryboarditem fromInfo.plist > NSExtension. -
Add the
NSExtensionPrincipalClasskey toInfo.plist > NSExtension- Value type:
String - Value:
$(PRODUCT_MODULE_NAME).<MainClassName>
For Objective-C projects, specify the class name directly.
- Value type:
-
Remove
MainInterface.storyboardfrom your project.
Add this key to your content extension’s Info.plist file.
- Key:
UNNotificationExtensionUserInteractionEnabled - Value type: Boolean
- Value:
YES
This screenshot illustrates an Info.plist file in a Swift-based implementation with configured NSExtensionAttributes and NSExtensionPrincipalClass.

This screenshot illustrates an Info.plist file in an Objective-C-based implementation with configured NSExtensionAttributes and NSExtensionPrincipalClass.

Implement the sfmcProvideConfig() method to define custom log levels and HTTP timeout settings.
View Swift code example
View Objective-C code example
iOS blocks insecure (non-HTTPS) URLs by default. To load carousel images from HTTP URLs, configure an exception.