Integrate the Android SDK
Configure the Service Extension
Configure the Content Extension
Configure Carousel Click Actions
Enable App Groups
Runtime Toggles
Integrate with Other Platforms
Handle URLs
Changelog
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.
Note
Notification Content Extensions run as separate processes within your app, providing isolation and enhancing security.
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.
1import UIKit
2import UserNotifications
3import UserNotificationsUI
4import MCExtensionSDK
5
6class NotificationViewController: SFMCNotificationViewController { }Header file
1#import <UIKit/UIKit.h>
2#import <MCExtensionSDK/MCExtensionSDK.h>
3
4@interface NotificationViewController : SFMCNotificationViewController
5
6@endImplementation file
1#import "NotificationViewController.h"
2
3@implementation NotificationViewController
4
5@endSFMCNotificationViewController fully manages UI rendering. Don’t implement or override any UIViewController methods in the principal class of the content extension.
Note
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.
Info.plist file, set the value for UNNotificationExtensionCategory under NSExtension > NSExtensionAttributes.The MCExtensionSDK builds the notification UI programmatically. Configure your project to build the UI in code.
Remove the storyboard reference by deleting the NSExtensionMainStoryboard item from Info.plist > NSExtension.
Add the NSExtensionPrincipalClass key to Info.plist > NSExtension
String$(PRODUCT_MODULE_NAME).<MainClassName>For Objective-C projects, specify the class name directly.
Note
Remove MainInterface.storyboard from your project.
Add this key to your content extension’s Info.plist file.
UNNotificationExtensionUserInteractionEnabledYESThis 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.
1import UIKit
2import UserNotifications
3import UserNotificationsUI
4import MCExtensionSDK
5
6class NotificationViewController: SFMCNotificationViewController {
7
8 override func sfmcProvideConfig() -> SFContentExtensionConfig {
9 var logLevel: LogLevel = .none
10 #if DEBUG
11 logLevel = .debug
12 #endif
13
14 return SFContentExtensionConfig(logLevel: logLevel, timeoutIntervalForRequest: 30.0)
15 }
16}1#import "NotificationViewController.h"
2
3@implementation NotificationViewController
4
5- (SFMCContentExtensionConfig *)sfmcProvideConfig {
6 SFMCExtensionSdkLogLevel logLevel = SFMCExtensionSdkLogLevelNone;
7#if DEBUG
8 logLevel = SFMCExtensionSdkLogLevelDebug;
9#endif
10 return [[SFMCContentExtensionConfig alloc] initWithLogLevel:logLevel timeoutIntervalForRequest:30.0];
11}iOS blocks insecure (non-HTTPS) URLs by default. To load carousel images from HTTP URLs, configure an exception.
Note