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 initialization params
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. https://docs.bidmachine.io/v3.0/docs/ad-request
let unitConfig = BidMachineUnitConfiguration("name", // NETWORK_NAME
.banner, // AD UNIT TYPE
[String : Any](), // REQUIRED NETWORK UNIT PARAMS
[String : Any]()) // OPTIONAL ANY EXTRAS PARAMS
let placement = try? BidMachineSdk.shared.placement(from: .banner)
let request = BidMachineSdk.shared.auctionRequest(placement: placement) {
$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;
BidMachinePlacement *placement = [[BidMachineSdk shared] placementFrom:PlacementFormatBanner
error:&error
builder:nil];
if (!placement) {
return;
}
BidMachineAuctionRequest *request = [[BidMachineSdk shared] auctionRequestWithPlacement:placement builder: ^(id<BidMachineAuctionRequestBuilderProtocol> _Nonnull builder) {
[builder withUnitConfigurations:@[unitConfig]];
}];