These instructions give an overview of integrating the MobileFuse SDK with your iOS app.
Current Version
...
Integration Steps Overview
Table of Contents | ||||
---|---|---|---|---|
|
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
Code Block | ||
---|---|---|
| ||
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:
Code Block | ||
---|---|---|
| ||
@import MobileFuseSDK; |
Step 2. Configure Data Privacy
Excerpt | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
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:
GDPR for European usersFor 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 should be invoked on the same MobileFusePrivacyPreferences object as above.
|
App Tracking Transparency Framework
Excerpt | |||||
---|---|---|---|---|---|
| |||||
You must also ensure that you have implemented the Apple App Tracking Transparency Framework into your app before any ad calls. 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
|
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. |
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 initWithAppId:@"00000" withPublisherId:@"0000" 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);
} |
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:
Step 5. Configure SKAdNetwork IDs
Recommended - follow the guide below to configure the MobileFuse buyer SKAdNetwork IDs in your app:
...
Testing your integration
Read our guide on testing your integration:
iOS - Testing integrations This page has moved to our new documentation:
...