The download and use of the SDK are subject to the Meson SDK Licensing Terms. If you do not agree to these terms, do not download, access, or use the SDK or the underlying services.
You can download the Integration Demo application to gain a better understanding. It demonstrates how you can integrate Meson Mediation into your app.
Meson supports both Cocoapods and manual download mechanisms to integrate our SDK.
For users of Xcode 15 and later versions, you must employ the most up-to-date release of CocoaPods.
CocoaPods is a dependency manager for Objective-C and Swift; it automates and simplifies the SDK integration process. See the CocoaPods Guide on Getting Started and Using CocoaPods for more information.
To integrate the Meson SDK with CocoaPods, enter the following in your podfile:
pod 'MesonSDK' , '1.0.0-beta13'
After downloading, unzip it and add MesonSDK.xcframework to your Xcode Project.
To add the mediated SDK adapter and SDK with CocoaPods, select the networks and add the following dependencies to the pod file. For more information on the supported networks and integration, see Network Guides.
If you are on the Amazon network, see Integrate Amazon SDK for more information.
Use the following command to update the repository:
pod install --repo-update
To download the mediated SDKs and the supported adapter, click the link provided for each network. For more information on the supported networks and integration, see Network Guides.
Network | Bid Type | Formats | |
---|---|---|---|
Facebook Audience Network
|
Real-time CPM |
Banner, Interstitial, MREC, Rewarded
|
Adapter | SDK |
Vungle
|
Real-time CPM |
Banner, Interstitial, MREC, Rewarded
|
Adapter | SDK |
InMobi Audience Bidding
|
Real-time CPM |
Banner, Interstitial, MREC, Rewarded, Native (iOS)
|
Adapter | SDK |
Mintegral
|
Real-time CPM |
Banner, Interstitial, MREC, Rewarded
|
Adapter | SDK |
Unity
|
Predicted CPM |
Banner, Interstitial, MREC, Rewarded
|
Adapter | SDK |
Applovin
|
Predicted CPM |
Banner, Interstitial, MREC, Rewarded
|
Adapter | SDK |
IronSource
|
Fixed CPM |
Interstitial, Rewarded
|
Adapter | SDK |
Google Admob
|
Fixed CPM |
Banner, Interstitial, MREC, Rewarded, Native
|
Adapter | SDK |
Google Ad Manager
|
Fixed CPM |
Banner, Interstitial, MREC, Rewarded, Native
|
Adapter | SDK |
AdColony Advanced Bidding
|
Real-time CPM |
Banner, Interstitial, MREC, Rewarded
|
Adapter | SDK |
In Xcode, go to build phases, select Link Binary With Libraries, click the + icon, and link the following frameworks in your project:
Add the following linker flags to the build settings at, Target > Build Settings > Linking > Other Linker Flags: -ObjC
To ensure uninterrupted support for ad delivery across all SDK Networks/Demand Partners, it's important to make the following changes in your info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Ensure that your info.plist does not contain exceptions besides 'NSAllowsArbitraryLoad', as this might create a conflict. For more information on ATS, see NSAppTransportSecurity.
Apple has introduced privacy settings to access WiFi details from iOS 12 onwards. To boost monetization and relevant user experience, we encourage sharing WiFi details for targeted advertising.
Enable ‘Access WiFi Information’ on your App ID.
Enable ‘Access WiFi Information’ for your target app from XCode capabilities.
Ensure WiFi Access is added to your App.entitlements file.
All publishers using Meta Audience Network and operating on iOS 14 or later must send the ATE flag. The ATE flag is for publishers to understand if the user has opted in/out to Apple’s ATT Framework.
To set this, publishers need to include the following code snippet as part of their initialisation code.
#warning("Import the following frameworks")
import AppTrackingTransparency
import FBAudienceNetwork
#warning("Call it before Meson SDK initialization")
static func updateMetaTrackingStatus() {
if #available(iOS 14, *) {
if ATTrackingManager.trackingAuthorizationStatus == .authorized {
FBAdSettings.setAdvertiserTrackingEnabled(true)
}
}
}
#warning("Import the following frameworks")
@import AppTrackingTransparency;
@import FBAudienceNetwork;
#warning("Call this method before Meson SDK init")
+(void)updateMetaTrackingStatus {
if (@available(iOS 14, *)) {
if ([ATTrackingManager trackingAuthorizationStatus] == ATTrackingManagerAuthorizationStatusAuthorized) {
[FBAdSettings setAdvertiserTrackingEnabled:YES];
}
}
}
MesonConstant.MESON_GDPR_CONSENT_AVAILABLE - Replace with MesonConstant.GDPR_CONSENT_AVAILABLE
MesonConstant.MESON_GDPR_CONSENT_IAB - Replace with MesonConstant.GDPR_CONSENT
MesonConstant.MESON_GDPR_CONSENT_GDPR_APPLIES - Replace with MesonConstant.GDPR
MesonSdkConfiguration.init(appId: String, consent: [String: Any])
- This will be removed in future version.MesonSdkConfiguration.init(appId: String, consent: [String: Any], buildType: MesonBuildType)
- This will be removed in future version.To initialize the SDK, invoke the initialize method from the MesonClass
. It is imperative to ensure the successful initialization of the SDK before proceeding with any other operations.
import UIKit
import MesonSDK
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Setting Log level
Meson.setLogLevel(.debug)
initializeMesonSDK()
return true
}
private func initializeMesonSDK() {
#warning("Please add your App ID")
let config = MesonSdkConfiguration(appId: "<APP_ID>")
Meson.initialize(sdkConfiguration: config) { error in
if let error = error as NSError?, let initializeError = MesonInitializationError.init(rawValue: error.code) {
print("Meson failed to initialize with error \(initializeError)")
return
}
print("Meson \(Meson.getSDKVersion()) initialized successfully")
}
}
}
#import "AppDelegate.h"
@import MesonSDK;
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Setting Log level
[Meson setLogLevel:LogLevelDebug];
[self initializeMesonSDK];
return YES;
}
- (void)initializeMesonSDK {
#warning("Please add your App ID")
MesonSdkConfiguration *sdkConfiguration = [[MesonSdkConfiguration alloc] initWithAppId:@"appId"];
void (^completionBlock)(NSError*) = ^( NSError* _Nullable error) {
if (error) {
NSLog(@"MesonSDK initialization error %@", error.description);
} else {
NSLog(@"Meson %@ SDK initialized successfully",[Meson getSDKVersion]);
}
};
[Meson initializeWithSdkConfiguration:sdkConfiguration completion:completionBlock];
}
@end
When logging is set to DEBUG, SDK will print key logs to the console that provide useful information about the initialization and bid request lifecycle.
// Setting Log level
Meson.setLogLevel(.debug)
// Setting Log level
[Meson setLogLevel:LogLevelDebug];