AdMob Bidding
Full Technical Documentation
To get full documentation and samples please refer to the GitHub page.
Integration
Add the following lines to your project's Podfile
target 'Target' do
project 'Project.xcodeproj'
pod 'BidMachineAdMobAdapter', '~> 3.1.1.2'
end
Initialization
The BidMachineAdMobAdapter
strarting 3.1.1.2 version offers robust support for both prebid and waterfall integration. Both integration types require to configure mediations group in AdMob account by adding BidMachine Custom Events and Mappings.
Waterfall:
Waterfall integration does not require BidMachineSdk
initialization code, as it is triggered automatically as part of the GADMobileAds
initialization.
However, if you need to configure additional BidMachineSdk
settings, refer to the documentation:
Warning
All parameters for BidMachine SDK must be set before starting AdMob SDK.
Code example:
BidMachineSdk.shared.populate { builder in
builder
.withTestMode(true)
.withLoggingMode(true)
.withBidLoggingMode(true)
.withEventLoggingMode(true)
}
GADMobileAds.sharedInstance().start(nil)
[BidMachineSdk.shared populate:^(id<BidMachineInfoBuilderProtocol> builder) {
[builder withTestMode:YES];
[builder withLoggingMode:YES];
[builder withBidLoggingMode:YES];
[builder withEventLoggingMode:YES];
}];
Prebid:
Warning
Before AdMob SDK initialization, you should start the BidMachine SDK. All parameters for BidMachine SDK must be set before starting.
BidMachineSdk.shared.populate { builder in
builder
.withTestMode(true)
.withLoggingMode(true)
.withBidLoggingMode(true)
.withEventLoggingMode(true)
}
BidMachineSdk.shared.initializeSdk("source id")
GADMobileAds.sharedInstance().start(nil)
[BidMachineSdk.shared populate:^(id<BidMachineInfoBuilderProtocol> builder) {
[builder withTestMode:YES];
[builder withLoggingMode:YES];
[builder withBidLoggingMode:YES];
[builder withEventLoggingMode:YES];
}];
[BidMachineSdk.shared initializeSdk: @"1"];
[[GADMobileAds sharedInstance] startWithCompletionHandler:^(GADInitializationStatus * _Nonnull status) {
NSDictionary *statuses = status.adapterStatusesByClassName;
NSLog(@"%@", [statuses.allKeys componentsJoinedByString:@","]);
}];
How to add all parameters is described here
Ad Format
Next, choose the ad format that best fits your app’s user experience.
Updated 4 days ago