Integration Guide

The Millennial Media iOS Ad SDK provides functionality for monetizing your iOS applications. With the SDK, you can easily integrate inline, interstitial, and native ads into your application.


  • Xcode 9.0 or higher
  • Deployment target of iOS 8.0 or higher

Adding the SDK to your project

1. Add MMAdSDK.framework to your Xcode project

Make sure to select “Copy Items to Destination” along with all appropriate targets when copying the MMSDK files to your project.

Swift developers – Add the following to your bridging header file

#import <MMAdSDK/MMAdSDK.h>

Link: Using Swift and Objective-C in same project

2. Add the following required frameworks to your project

  • AdSupport.framework
  • AudioToolbox.framework
  • AVFoundation.framework
  • CoreGraphics.framework
  • CoreLocation.framework
  • CoreTelephony.framework
  • CoreMedia.framework
  • EventKit.framework
  • EventKitUI.framework
  • Foundation.framework
  • libxml2.tbd
  • MediaPlayer.framework
  • MessageUI.framework
  • SystemConfiguration.framework
  • UIKit.framework
  • WebKit.framework

In earlier versions of Xcode, tbd libraries were instead dylib.

Link: How to add frameworks to your Xcode project.

Note: CoreLocation is a required framework, even if sending location data is disabled. For more information about location, see here.

3. Add required usage purpose strings to Info.plist

The SDK requires usage strings for Calendar, Reminders, Photos, Camera, and Location, which will need to be added to your Info.plist. This is required for iOS 10+ support or your app will crash on some ad interactions, and may be rejected from the App Store. These keys are all added to the top level of the Info.plist as strings, and may be accessed from within Xcode as “Privacy - Usage Description". The required Info.plist keys and suggested values relating to the use of these features for ads are listed below. If your app already uses any of these features, you should use your own purpose strings.

  • NSCalendarsUsageDescription: This interaction requires calendar access.
  • NSRemindersUsageDescription: This interaction will add a reminder.
  • NSCameraUsageDescription: This feature requires using the camera.
  • NSPhotoLibraryUsageDescription: This feature requires a stored image.
  • NSPhotoLibraryAddUsageDescription: This feature wants to add a photo to your library.
  • NSLocationWhenInUseUsageDescription: This app wants to display nearby features.

Note: The SDK does not monitor location in backgrounded apps. However, if your app already uses the NSLocationAlwaysUsageDescription key, you do not also need to include the NSLocationWhenInUseUsageDescription key.

4. Add NSAllowsArbitraryLoads to Info.plist

In order to serve ads, the SDK requires that you allow arbitrary loads. In the top level of your Info.plist, add the App Transport Security Settings key as a dictionary type, and then to that dictionary, add the NSAllowsArbitraryLoads key as a boolean and set the value to Yes.

If you would like to enforce App Transport Security (ATS) for specific domains which you believe should be blacklisted from being allowed to load arbitrary content, please read Apple’s documentation on ATS configuration.

5. Add the “-ObjC” linker flag to your target

Link: How to add the “-ObjC” linker flag to your target.

6. Enable Bitcode (Optional)

Apple introduced ‘App Thinning’ in iOS 9, which allows for compiling an app as ‘bitcode’, or an intermediate representation that on-demand compiles for the delivery device from the App Store. If you wish utilize App Thinning, you may do so by navigating to your target’s “Build Settings” and changing the value of Enable Bitcode to Yes.

7. Set up the AppSettings configuration for the SDK

The AppSettings object is used to configure top-level SDK information at the time of initialization. In particular it controls site ID and optionally, Children’s Online Privacy Protection Act (COPPA) settings for any user who is subject to COPPA regulation.


MMAppSettings* appSettings = [[MMAppSettings alloc] init];
appSettings.siteId = <YOUR SITE ID>;


let appSettings = MMAppSettings()
appSettings.siteId = <YOUR SITE ID>

After SDK initialization, you cannot replace the AppSettings object, but may modify any existing one.

8. Set up the UserSettings configuration for the SDK (Optional)

The UserSettings object is used to configure the SDK on a per-user basis, and consists entirely of targeting information. For more about these values and what they represent, see the full documentation.

Please note that the information set in this object will not be sent on ad requests for users under the jurisdiction of GDPR or similar future privacy regulations that have not consented to the use of their personal data for advertising purposes.


MMUserSettings* userSettings = [[MMUserSettings alloc] init];
// Provide userSettings values here, as appropriate


let userSettings = MMUserSettings()
// Provide userSettings values here, as appropriate

After SDK initialization, you may reset this value using the userSettings property of the global SDK instance.

9. Initialize the SDK


#import "AppDelegate.h"
#import <MMAdSDK/MMAdSDK.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
	[[MMSDK sharedInstance] initializeWithSettings:<APP CONFIG OBJECT> withUserSettings:<USER CONFIG OBJECT>];
	return YES;


func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    MMSDK.sharedInstance().initialize(with: <APP CONFIG OBJECT>, with: <USER CONFIG OBJECT>)

    return true

Both the <APP CONFIG OBJECT> and <USER CONFIG OBJECT> are allowed to be nil if your application does not require additional configuration.

10. Set General Data Protection Regulation (GDPR) properties

In order to use the MM SDK to serve personalized advertising (based on information such as device advertising identifiers, location, and other personal data) to EU users, you need consent for the use of Oath ad products. Use setConsentRequired: to indicate if the user falls under GDPR jurisdiction. Use setConsentDataValue:forKey: to set a consent string for the user. These values should be set after initialization and before requesting an ad. Consent information may be updated at anytime during the app’s execution should the user’s consent data or status change. Additional information can be found in the General Data Protection Regulation section.

// Set to true if the user falls under GDPR jurisdiction.
[[MMSDK sharedInstance] setConsentRequired:YES];

// Sets the IAB Consent String
[[MMSDK sharedInstance] setConsentDataValue:@<PUBLISHER-PROVIDED IAB CONSENT STRING> forKey:MMIABConsentKey] 

11. Turn on In-App Purchases for StoreKit support (Optional)

If an ad contains a link to the App Store, using the StoreKit.framework will open the link and process in-app purchases within a modal dialog in your app. This means your users are able to make purchases without ever leaving your app. If your app does not link StoreKit.framework, clicking on an ad that contains a link to the store will launch the App Store, causing your users to navigate away away from your app. Please note that in order to support StoreKit.framework, your app must have In-App Purchase capability turned on.

For more information on StoreKit, please refer to StoreKit.framework documentation. To learn more about In-App Purchases and how to turn them on for your app, please refer to the Adding Capabilities Guide.

Additional Topics