# Getting started

## CocoaPods (Recommended)

To integrate the Bidapp SDK through CocoaPods:

1. Add the following lines to your Podfile:

```ruby
pod 'bidapp'
```

2. Run the following command on the command line:

```ruby
pod install --repo-update
```

{% hint style="info" %}
For more information on using CocoaPods, refer to [CocoaPods’ documentation](https://guides.cocoapods.org/using/using-cocoapods).
{% endhint %}

{% hint style="warning" %}
The SDK requires that you set the iOS deployment target to iOS 11.0 or above.
{% endhint %}

## Get the pubid string

Request pubid by sending email to <connect@bidapp.io>

## Integrate Custom SDK Adapters

Bidapp SDK contains implementations of adapters to other SDKs.&#x20;

To install them:

1. Add the following lines or any combination of them to your Podfile:

```ruby
pod 'bidapp/Applovin'
pod 'bidapp/ApplovinMax'
pod 'bidapp/Unity'
pod 'bidapp/Liftoff'
pod 'bidapp/AdMob'
pod 'bidapp/Chartboost'
```

2. Run the following command on the command line:

```ruby
pod install --repo-update
```

{% hint style="info" %}
If you want to receive release updates for adapters, subscribe to our GitHub repository: [GitHub repository](https://github.com/bidapphub/bidapp-ads-ios)
{% endhint %}

## Initialize the SDK

Initialize the SDK in your app delegate’s `application:applicationDidFinishLaunching: method`

Ad assets that are fully cached result in a better user experience. Therefore, always initialize the Bidapp SDK on startup so as to give mediated networks the maximum amount of time to cache ads. This is especially important with video ads.

{% tabs %}
{% tab title="Objective-C" %}

```objectivec
#import <bidapp/bidapp.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    BIDConfiguration *bidConfig = [BIDConfiguration new];

    //Comment out those ad formats that you don`t use:
    [bidConfig enableInterstitialAds];
    [bidConfig enableRewardedAds];
    [bidConfig enableBannerAds];

    //TODO: replace this pubid with your personal, obtained from bidapp
    NSString *pubid = @“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”;
    if (@available(iOS 14, *)) {
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
            [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus s){}];
            
            [BidappAds startWithPubid:pubid config:bidConfig];
        });
    }
    else {
	[BidappAds startWithPubid:pubid config:bidConfig];
    }
    
    return YES;
}
```

{% endtab %}

{% tab title="Swift" %}

```swift
import bidapp

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    BIDInterstitial.loadDelegate = self
    BIDRewarded.loadDelegate = self
        
    let bidConfig = BIDConfiguration()
        
    //Comment out those ad formats that you don`t use:
    bidConfig.enableInterstitialAds()
    bidConfig.enableRewardedAds()
    bidConfig.enableBannerAds()
    
    //TODO: replace this pubid with your personal, obtained from bidapp
    let pubid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    if #available(iOS 14, *) {
        
        let deadlineTime = DispatchTime.now() + .seconds(1)
        DispatchQueue.main.asyncAfter(deadline: deadlineTime) {
            ATTrackingManager.requestTrackingAuthorization { _ in
                BidappAds.start(withPubid: pubid, config: bidConfig)
            }
        }
    } else {
        BidappAds.start(withPubid: pubid, config: bidConfig)
    }
      
    return true
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Pay attention to the **pubid** string obtained earlier at [Get the pubid string](#get-the-pubid-string) of this instruction.
{% endhint %}

## iOS 14 Support

In iOS 14, Apple introduced global privacy changes that you need to comply with. This section explains how to comply with these changes and thereby avoid a material drop in revenue.

## SKAdNetwork

Update your app’s **Info.plist** with network-specific identifiers. See the documentation for [**SKAdNetwork** instructions](/integration/ios/skadnetwork.md).

## iOS 15 SKAdNetwork Reporting

Enable **iOS 15 SKAdNetwork** install postback reporting by using the app’s **Info.plist**:

1\. In your app’s **Info.plist**, create a new key named `NSAdvertisingAttributionReportEndpoint` of type String.

2\. Give that key the value: <https://postbacks-app.com&#x20>;

## Consent and Data APIs

In order to ensure you obtain consent from your users in applicable jurisdictions on behalf of our monetization partners and correctly pass consent flag values to Bidapp, please review [**App Policy Settings**](/integration/ios/app-policy-settings.md)

See the [**Interstitials Ads**](/integration/ios/interstitial-ads.md), [**Rewarded Ads**](/integration/ios/rewarded-ads.md) and [**Banner Ads**](/integration/ios/banner-ads.md) pages to learn how to **integrate** various **ad formats**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bidapp.io/integration/ios/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
