Integrate the MobileFuse SDK for iOS

These instructions give an overview of integrating the MobileFuse SDK with your iOS app.

Integration Steps Overview

Step 1. Download the MobileFuse iOS SDK

The MobileFuse SDK is distributed on CocoaPods.

Podfile setup

Update your project’s podfile to include the MobileFuse SDK

source 'https://github.com/CocoaPods/Specs.git' target 'MyApp' do pod 'MobileFuseSDK' end

Once you have run pod install you should then be able to include the MobileFuse SDK in your app, using the following import statement:

@import MobileFuseSDK;

Step 2. Configure Data Privacy

The MobileFuse SDK supports privacy configurations that can be managed using an IAB compatible US Privacy String, and IAB Consent Framework strings for GDPR. You can also notify the SDK whether your user subject to COPPA, due to them being under 13 years of age.

The following snippet demonstrates configuration for the US privacy and COPPA compliance:

MobileFusePrivacyPreferences *privacyPreferences = [[MobileFusePrivacyPreferences alloc] init]; [privacyPreferences setSubjectToCoppa:NO]; // Shound be YES if user is under 13 years of age [privacyPreferences setUsPrivacyConsentString:@"<US Privacy String>"]; // e.g. 1YNN [MobileFuse setPrivacyPreferences:privacyPreferences];

GDPR for European users

For your European users, you must supply an IAB-compatible privacy consent string. The following example shows how to declare consent for a user which is subject to GDPR due to being located in an EAA country. Note that this can simply be chained to the same MobileFusePrivacyPreferences.Builder() as above.

To ensure that you get reliable ad fill and the best CPMs, please ensure that you implement the data privacy methods that are relevant to your user.

App Tracking and Transparency Framework

You must also ensure that you have implemented the Apple App Tracking and Transparency Framework into your app before you set up any of your ad units. This sample code shows how you can request the authorization. If authorization has already been granted, then the callback will immediately fire with the correct status, therefore it’s advisable to call the requestTrackingAuthorizationWithCompletionHandler method every time your app launches.

Step 3. Initialize the SDK

To initialize the SDK, you’ll need to provide a valid App ID.

If you don’t have an App ID for the SDK, please ask your MobileFuse contact. You’ll be given a unique App ID for each app and each platform that you publish to.

The following code snippet demonstrates a simple SDK initialization. Passing in the delegate is optional, but it will allow you to handle the onInitSuccess and onInitFail callbacks.

Step 4. Create Ad Units

Once the SDK has initialized, you can start using MobileFuse ad units. The following guides provide steps to get started with each of our supported ad formats: