These instructions give an overview of integrating the MobileFuse SDK with your iOS app.
Integration Steps Overview
...
Table of Contents |
---|
Step 1. Download the MobileFuse iOS SDK
The MobileFuse SDK is distributed on CocoaPods.
...
Code Block | ||
---|---|---|
| ||
@import MobileFuseSDK; |
...
Step 2
...
To initialize the SDK, you’ll need to provide a valid App ID.
Info |
---|
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. |
🧪 Internal Testing
You can use the following App IDs for testing:
Publisher ID: 3068
App ID: 10914
...
.
...
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.
...
Info |
---|
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. |
🧪 Internal Testing
Here are some opted-in consent strings that you can use for internal testing:
US Privacy: 1YNN
EU IAB Consent String: CPJB6bHPJB6bHK3AAAENBiCAAAAAAAAAAAAAHGwAQHGgAAAA.IIENf_X__bX9n-_79__t0eY1f9_r_v-Qzjhfdt-8N2L_W_L0X_2E7NF36pq4KuR4ku3bBIQNtHMnUTUmx6olVrzPsak2Mr7NKJ7LkmnsZe2dYGHtfn91T-ZKZ7_7__9f73z_______9_3____________-_____9____________9__w
...
Code Block | ||
---|---|---|
| ||
#import <AppTrackingTransparency/AppTrackingTransparency.h> // ... - (void)requestAppTracking { [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { switch (status) { case ATTrackingManagerAuthorizationStatusNotDetermined: NSLog(@"ATT - Request not determined"); break; case ATTrackingManagerAuthorizationStatusRestricted: NSLog(@"ATT - Request restricted"); break; case ATTrackingManagerAuthorizationStatusDenied: NSLog(@"ATT - Request denied"); break; case ATTrackingManagerAuthorizationStatusAuthorized: NSLog(@"ATT - Request authorized"); break; } // Run the initialization on our main thread: dispatch_async(dispatch_get_main_queue(), ^{ [self initMobileFuseSdk]; }); }]; } |
Step 3. Initialize the SDK
To initialize the SDK, you’ll need to provide a valid App ID.
Info |
---|
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. |
🧪 Internal Testing
You can use the following App IDs for testing:
Publisher ID: 3068
App ID: 10914
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.
Code Block | ||
---|---|---|
| ||
// ... - (void)viewDidLoad { [super viewDidLoad]; [self requestAppTracking]; // Will call initMobileFuseSdk when ATT has been resolved. } - (void)initMobileFuseSdk { [MobileFuse init:self.view withAppId:@"1091400000" withPublisherId:@"30680000" withDelegate:self]; } // IMFInitializationCallbackReceiver delegate implementation - (void)onInitSuccess:(NSString *)appId withPublisherId:(NSString *)publisherId { NSLog(@"SDK Initialization successful"); } - (void)onInitFailed:(NSString *)message { NSLog(@"SDK Initialization failed: %@", message); } |
🧪 Internal Testing
You won’t receive test ads unless you override some settings in the SDK! You should override these settings before you create your first ad unit, so it’s safest to place them right at the top of your code within your main activity’s onCreate
method. We have some undocumented methods that allow you to modify how the SDK interacts with the ad server:
Ensure you import the hidden MobileFuseSettings file before using these methods: #import <MobileFuseSDK/MobileFuseSettings.h>
Configure the app to use a testing IFA - this is a special IFA that will receive test ads:
[MobileFuseSettings setOverride:MOBILEFUSE_SETTING_IFA withValue:@"2C0B92BE-2850-41BE-86EB-549684CD647A"];
Optionally configure the app to use a custom IP address - you can use this to pretend that you’re somewhere that you’re not, e.g. for testing GDPR within EU:
[MobileFuseSettings setOverride:MOBILEFUSE_SETTING_IP_ADDRESS withValue:@"46.208.0.0"]; // UK IP to test GDPR
...
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:
🧪 Internal Testing
Here are some test placement IDs that you can use!
Interstitial: Rich-media only -
418284
Interstitial: Video only -
418285
Interstitial: Mixed -
418286
Banner:
418311
Transparent Interstitial:
418646
Pull-Tab:
418647
...