# Getting Started Guide

Get Started

To display Adx3 ads, the first step is to integrate the Adx3 Mobile Ads SDK into the app. After integrating the ad SDK, you can continue to implement one or more supported ad formats.

## Prerequisites

* Use Xcode 13.4.1 or higher
* Target iOS 10.0 or higher
* Recommendation:  Management terminal background application SDK and advertising slot ID

## Import the Mobile Ads SDK

1. Download：<https://pub-block.s3.ap-east-1.amazonaws.com/base/202306/4fd9e3ee1bfc0c6b.zip>
2. Unzip the SDK frameworks, then import the following frameworks into your Xcode project:
   * Adx3Framework.framework
3. Add the `-ObjC` linker flag to **Other Linker Flags** in your project's build settings:

   <figure><img src="https://723505504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzJW2BSwIcZ1UEBgvPFdv%2Fuploads%2Fe825R7qi9Is9exm2GcBZ%2Fimage.png?alt=media&#x26;token=39f4b6e1-d0ca-461e-9ccc-6f918e35d2bd" alt=""><figcaption></figcaption></figure>

### Update your Info.plist <a href="#update_your_infoplist" id="update_your_infoplist"></a>

Update your app's`Info.plist` file to add the following key:

```
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
```

### Initialize the Mobile Ads SDK <a href="#initialize_the_mobile_ads_sdk" id="initialize_the_mobile_ads_sdk"></a>

Before loading the ad, please call the initWithAppId:(NSString \*)appId success:(isSuccess)success method on \[Adx3AdManager sharedManager]. This method will initialize the SDK, and after the initialization is complete, call back the result of the initialization. This only needs to be done once, preferably at the app startup. It is recommended that you call initWithAppId:(NSString \*)appId success:(isSuccess)success as early as possible The following example shows how to call the initWithAppId:initWithAppId: (NSString \*)appId success:(isSuccess)success method in the Applegate

#### Example AppDelegate.m (excerpt)

{% tabs %}
{% tab title="Swift" %}

```swift
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        Adx3AdManager.shared().initWithAppId("Your App ID") { isSuccess in
            //result handler
        }
        // Override point for customization after application launch.
        return true
    }
    
    func applicationDidBecomeActive(_ application: UIApplication) {
        Adx3AdManager.shared().applicationDidBecomeActive(application)
    }
    
    func applicationDidEnterBackground(_ application: UIApplication) {
        Adx3AdManager.shared().applicationDidEnterBackground(application)
    }
}
```

{% endtab %}

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

```objectivec
#import "Adx3Framework/Adx3Ad.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [[Adx3AdManager sharedManager] initWithAppId:@"Your App ID" success:^(BOOL isSuccess) {
       //result handler
    }];
    return YES;
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    [[Adx3AdManager sharedManager] applicationDidBecomeActive:application];
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    [[Adx3AdManager sharedManager] applicationDidEnterBackground:application];
}

@end
```

{% endtab %}
{% endtabs %}

### Select an ad format <a href="#select_an_ad_format" id="select_an_ad_format"></a>

### App Open

<div align="left"><figure><img src="https://723505504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzJW2BSwIcZ1UEBgvPFdv%2Fuploads%2F7iktsWTGsyDs4BTUrGyJ%2Fimage.png?alt=media&#x26;token=e8ec80cf-2cc6-4e86-b6ca-766ce72faf9b" alt=""><figcaption></figcaption></figure></div>

App open ads are a special ad format for publishers who want to load ads on app launch. Users can close the open-screen advertisement at any time.

&#x20; [<mark style="background-color:blue;">Implement an App Open Ads</mark>](https://docs.adx3.io/interface-documentation/ios/ad-formats/app-open) &#x20;

### Interstitial

<div align="left"><figure><img src="https://723505504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzJW2BSwIcZ1UEBgvPFdv%2Fuploads%2FL2gdJB9mL2TdXYL8sqQg%2Fimage.png?alt=media&#x26;token=59275c06-5a07-43e1-8565-21947ef78c23" alt=""><figcaption></figcaption></figure></div>

The full-screen ad covers the app UI until dismissed by the user. They are best displayed at natural pauses in the app's execution flow, such as between game levels or after the user has just completed a task.

[  <mark style="color:blue;background-color:blue;">Implement an Interstitial</mark>  ](https://docs.adx3.io/interface-documentation/ios/ad-formats/interstital)

### Banner

<div align="left"><figure><img src="https://723505504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzJW2BSwIcZ1UEBgvPFdv%2Fuploads%2FkE154d1kRjC5gatCJ4JR%2Fimage.png?alt=media&#x26;token=ae0d0edf-a8fe-4f04-81aa-f56fe2dffb0e" alt=""><figcaption></figcaption></figure></div>

Rectangular ads that appear at the top or bottom of a device's screen. Banner ads stay on the screen while the user interacts with the app and can automatically refresh after a period of time.

[  <mark style="color:blue;background-color:blue;">Implement a Banner</mark>](https://docs.adx3.io/interface-documentation/ios/ad-formats/banner) &#x20;

### Rewarded

<div align="left"><figure><img src="https://723505504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzJW2BSwIcZ1UEBgvPFdv%2Fuploads%2FK9KYNRUd1MnP8O4bwr1Y%2Fimage.png?alt=media&#x26;token=0a21501c-656f-4cee-991a-0b399a925aff" alt=""><figcaption></figcaption></figure></div>

Ads that reward users for watching short videos and interacting with playable ads and surveys. Good for monetizing free-to-play users.

[  <mark style="color:blue;background-color:blue;">Implement a Rewarded</mark>  ](https://docs.adx3.io/interface-documentation/ios/ad-formats/rewarded)

### Native

<div align="left"><figure><img src="https://723505504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzJW2BSwIcZ1UEBgvPFdv%2Fuploads%2FkDnQ9ETZMavW6d2SeCTr%2Fimage.png?alt=media&#x26;token=72160351-117a-4e8a-9e7d-b9d69ce7037b" alt=""><figcaption></figcaption></figure></div>

Customizable ads that match the look and feel of your app. You decide how and where they're placed, so the layout is more consistent with your app's design.

[  <mark style="color:blue;background-color:blue;">Implement a Native</mark>  ](https://docs.adx3.io/interface-documentation/ios/ad-formats/native)

### Multiple

<div align="left"><figure><img src="https://723505504-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzJW2BSwIcZ1UEBgvPFdv%2Fuploads%2FpnjcMlzGqiPBUnEPwtQm%2Fimage.png?alt=media&#x26;token=369192f5-ea79-4389-9c81-e7bd4b774eaf" alt=""><figcaption></figcaption></figure></div>

Ads customized for lists or waterfall layouts

[  <mark style="color:blue;background-color:blue;">Implement a Multiple</mark>  ](https://docs.adx3.io/interface-documentation/ios/ad-formats/multiple)
