Header Bidding

Integration

🚧

Requirements:

iOS 12.0+ ( start for 2.3.0.0 v )
Xcode: 14.2

BidMachine SDK version >= 2.3.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.3.0.0"
    pod "BidMachineAdColonyAdapter", "~> 2.3.0.0"
    pod "BidMachineAmazonAdapter", "~> 2.3.0.0"
    pod "BidMachineCriteoAdapter", "~> 2.3.0.0"
    pod "BidMachineMetaAudienceAdapter", "~> 2.3.0.0"
    pod "BidMachineMyTargetAdapter", "~> 2.3.0.0"
    pod "BidMachineSmaatoAdapter", "~> 2.3.0.0"
    pod "BidMachineTapjoyAdapter", "~> 2.3.0.0"
    pod "BidMachineVungleAdapter", "~> 2.3.0.0"
    pod "BidMachinePangleAdapter", "~> 2.3.0.0"
    pod "BidMachineMintegralAdapter", "~> 2.3.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 ParametersType
app_idString
Ad Unit ParametersType
zone_idString

Amazon

πŸ“˜

Network Name

amazon

Initialization ParametersType
app_keyString
Ad Unit ParametersType
slot_uuidString

Criteo

πŸ“˜

Network Name

criteo

Initialization ParametersType
publisher_idString
Ad Unit ParametersType
ad_unit_idString
orientation(optional)String (portrait or landscape)

Meta

πŸ“˜

Network Name

meta_audience

Initialization ParametersType
app_idString
placement_idsArray of String
Ad Unit ParametersType
meta_keyString

MyTarget

πŸ“˜

Network Name

my_target

Initialization Parameters
does not contain required parameters for initialization
Ad Unit ParametersType
slot_idString

Notsy

πŸ“˜

Network Name

notsy

Initialization Parameters
does not contain required parameters for initialization
Ad Unit ParametersType
notsy_pfString
scoreString
priceString
ad_unit_idString

Pangle

πŸ“˜

Network Name

pangle_sdk

Initialization ParametersType
app_idString
Ad Unit ParametersType
slot_idString

Smaato

πŸ“˜

Network Name

smaato

Initialization ParametersType
publisher_idString
Ad Unit ParametersType
ad_space_idString

Tapjoy

πŸ“˜

Network Name

tapjoy

Initialization ParametersType
sdk_keyString
Ad Unit ParametersType
placement_nameString

Vungle

πŸ“˜

Network Name

vungle

Initialization ParametersType
app_idString
Ad Unit ParametersType
placement_idString