iOS
Integrate the MobileFuse SDK for iOS
These instructions give an overview of integrating the MobileFuse SDK with your iOS app.
Mediation Platforms
If you want to integrate using a mediation platform such as AppLovin MAX or AdMob Mediation, please go here:
Current Version
iOS SDK: <<sdkVersioniOS>>
<<sdkVersioniOS>>
Released December 4th 2024
Integration Steps Overview
Step 1. Add the MobileFuse SDK to your app
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', '<<sdkVersioniOS>>'
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
Follow our guide to set up Data Privacy
- Ensure that you configure ATTS in your app
- Provide any relevant consent strings (US Privacy, TCF, and/or GPP)
Step 3. Initialize MobileFuse
After setting up MobileFusePrivacyPreferences and MobileFuseTargetingData (if using), you should initialize the SDK with the following methods:
// Make your interface conform to the IMFInitializationCallbackReceiver delegate protocol
@interface ViewController () <IMFInitializationCallbackReceiver>
- (void)onInitSuccess:(NSString *)appId withPublisherId:(NSString *)publisherId;
- (void)onInitError:(NSString *)appId withPublisherId:(NSString *)publisherId withError:(MFAdError *)error;
@end
@implementation ViewController
- (void)viewDidLoad {
// Call init and set your delegate to get the onInitSuccess and onInitError callbacks
[MobileFuse initWithDelegate:self];
}
- (void)onInitSuccess:(NSString *)appId withPublisherId:(NSString *)publisherId {
// Init was a success! You can now call other methods from the MobileFuse SDK
}
- (void)onInitError:(NSString *)appId withPublisherId:(NSString *)publisherId withError:(MFAdError *)error {
// Init failed. Handle error case
NSLog(@"%@", error.message);
}
Note that if you try to load an ad before calling the initialization method, the SDK will initialize itself before requesting an ad, which will cause the first ad requested to take longer to become available.
Step 4. Create Ad Units
The following guides provide steps to get started with each of our supported ad formats:
Step 5. Configure SKAdNetworkIDs
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:
Updated 2 months ago