Asynchronous Basic Integration

This placement requires iOS 13 and above.

Asynchronous native banner placements wrap the native ads placement providing the same functionality but supporting Swift Concurrency for requesting ads.

Create Placement

To create an instance of AATAsyncNativeAdPlacement, use the following API:

var placement = AATSDK.createAsyncNativeAdPlacement(name: "<PLACEMENT_NAME>", supportsMainImage: true)

The argument supportsMainImage determines if the placement will use the main image asset. Remember that if the main image is used, it must be displayed.

Listen to Callbacks

Through the use of AATAsyncNativePlacementDelegate, you can listen to the different placement callbacks.

placement.delegate = self

Request Ad

To request a native ad, use the following API:

Task {
    guard let nativeAd = await placement.reload() else {
        return
    }
    // use the nativeAd data
}

Report adspace

See the native ads ad spaces reporting.

Retrieve the Native Assets

See retrieving native ad assets documentation.

Track Native Ad

See tracking native ad data documentation.

Complete Code Example

Last updated