Header Bidding
Integration
Requirements:
iOS 12.0+ ( start for 2.3.0.0 v )
Xcode: 14.2BidMachine SDK version >= 2.4.0.0
CocoaPods
Adapters are distributed as sub-specs with external dependencies. Add following lines into your Podfile:
Note
If you haven't used CocoaPods before, please read this guide first.
platform :ios, '12.0'
source 'https://github.com/appodeal/CocoaPods.git'
source 'https://cdn.cocoapods.org/'
workspace 'YourApp.xcworkspace'
use_frameworks!
target 'YourTarget' do
project 'YourProject/YourTarget.xcodeproj'
pod "BidMachine", "~> 2.4.0.0"
pod "BidMachineAdColonyAdapter", "~> 2.4.0.0"
pod "BidMachineAmazonAdapter", "~> 2.4.0.0"
pod "BidMachineCriteoAdapter", "~> 2.4.0.0"
pod "BidMachineMetaAudienceAdapter", "~> 2.4.0.0"
pod "BidMachineMyTargetAdapter", "~> 2.4.0.0"
pod "BidMachineSmaatoAdapter", "~> 2.4.0.0"
pod "BidMachineTapjoyAdapter", "~> 2.4.0.0"
pod "BidMachineVungleAdapter", "~> 2.4.0.0"
pod "BidMachinePangleAdapter", "~> 2.4.0.0"
pod "BidMachineMintegralAdapter", "~> 2.4.0.0"
end
Registration
To register the Header Bidding Network - you need to call the registration method with network required initialization params
let config = BidMachineNetworkConfiguraton("NETWORK_NAME", // NETWORK_NAME
[String : Any](), // REQUIRED NETWORK INIT PARAMS
[String : Any]()) // OPTIONAL ANY EXTRAS PARAMS
BidMachineSdk.shared.registerNetworks([config])
BidMachineNetworkConfiguraton *config = [[BidMachineNetworkConfiguraton alloc]
initWithName:@"NETWORK_NAME" // NETWORK_NAME
params:@{} // REQUIRED NETWORK INIT PARAMS
extras:@{}]; // OPTIONAL ANY EXTRAS PARAMS
[BidMachineSdk.shared registerNetworks:@[config]];
Request with Header Bidding Networks
In order for header bidding networks to participate in bidding, you need to add to the request all the bidding ad units with which you want to auction. More info about request
let unitConfig = BidMachineUnitConfiguration("name", // NETWORK_NAME
.banner, // AD UNIT TYPE
[String : Any](), // REQUIRED NETWORK UNIT PARAMS
[String : Any]()) // OPTIONAL ANY EXTRAS PARAMS
let requestConfig = try? BidMachineSdk.shared.requestConfiguration(.banner)
requestConfig?.populate { $0.withUnitConfigurations([unitConfig]) }
BidMachineUnitConfiguration *unitConfig = [[BidMachineUnitConfiguration alloc]
initWithName:@"name" // NETWORK_NAME
format:BidMachinePlacementFormatBanner // AD UNIT TYPE
params:@{} // REQUIRED NETWORK UNIT PARAMS
extras:@{}]; // OPTIONAL ANY EXTRAS PARAMS
NSError *error = nil;
id<BidMachineRequestConfigurationProtocol> requestConfig = [BidMachineSdk.shared requestConfiguration:BidMachinePlacementFormatBanner error:&error];
[requestConfig populate:^(id<BidMachineRequestBuilderProtocol> builder) {
[builder withUnitConfigurations:@[unitConfig]];
}];
Test mode + Logging mode
BidMachineSdk.shared.biddingInfo.populate {
$0.withTestMode(true)
.withLoggingMode(true)
}
[BidMachineSdk.shared.biddingInfo
populate:^(id<BidMachineBiddingInfoBuilderProtocol> builder) {
[builder withTestMode:YES];
[builder withLoggingMode:YES];
}];
Bidding Networks Params
AdColony
Network Name
adcolony
Initialization Parameters | Type |
---|---|
app_id | String |
Ad Unit Parameters | Type |
---|---|
zone_id | String |
Amazon
Network Name
amazon
Initialization Parameters | Type |
---|---|
app_key | String |
Ad Unit Parameters | Type |
---|---|
slot_uuid | String |
Criteo
Network Name
criteo
Initialization Parameters | Type |
---|---|
publisher_id | String |
Ad Unit Parameters | Type |
---|---|
ad_unit_id | String |
orientation(optional) | String (portrait or landscape) |
Meta
Network Name
meta_audience
Initialization Parameters | Type |
---|---|
app_id | String |
placement_ids | Array of String |
Ad Unit Parameters | Type |
---|---|
meta_key | String |
MyTarget
Network Name
my_target
Initialization Parameters |
---|
does not contain required parameters for initialization |
Ad Unit Parameters | Type |
---|---|
slot_id | String |
Pangle
Network Name
pangle_sdk
Initialization Parameters | Type |
---|---|
app_id | String |
Ad Unit Parameters | Type |
---|---|
slot_id | String |
Smaato
Network Name
smaato
Initialization Parameters | Type |
---|---|
publisher_id | String |
Ad Unit Parameters | Type |
---|---|
ad_space_id | String |
Tapjoy
Network Name
tapjoy
Initialization Parameters | Type |
---|---|
sdk_key | String |
Ad Unit Parameters | Type |
---|---|
placement_name | String |
Vungle
Network Name
vungle
Initialization Parameters | Type |
---|---|
app_id | String |
Ad Unit Parameters | Type |
---|---|
placement_id | String |
Updated 11 months ago