---
updatedAt: 2025-11-11T02:14:46.000Z
agentTools:
  projectIndex: https://docs.bidmachine.io/v2.0/llms.txt
---

# Header Bidding

## Integration

> 🚧 Requirements:
>
> iOS 12.0+ ( start for 2.3.0.0 v )\
> Xcode: 14.2
>
> BidMachine 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 <a href="https://guides.cocoapods.org/using/getting-started.html">this guide</a> first.

```ruby
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 <a href="https://docs.bidmachine.io/v2.0/docs/header-bidding#bidding-networks-params">required initialization params</a>

```swift
let config = BidMachineNetworkConfiguraton("NETWORK_NAME",   // NETWORK_NAME
                                           [String : Any](), // REQUIRED NETWORK INIT PARAMS
                                           [String : Any]()) // OPTIONAL ANY EXTRAS PARAMS
BidMachineSdk.shared.registerNetworks([config])
```
```objectivec
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. <a  href="https://docs.bidmachine.io/v2.0/docs/ad-request">More info about request</a>

```swift
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]) }
```
```objectivec
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

```swift
BidMachineSdk.shared.biddingInfo.populate {
  $0.withTestMode(true)
  	.withLoggingMode(true)
}
```
```objectivec
[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 |