App Open

The app open ads are a special format which main purpose is to allow the monetization of the app load screens.

These ads can be closed anytime and are meant to be shown when the app moves to foreground.

Integration

This ad format can be only integrated through code, by implementing any of the two possible ways of integration that are described below.

Manual

In this kind of integration, it is needed to create an instance of the WAAppOpenAd class and use the loadAd() and showAd() methods to make the ad load and show on demand. The publisher is the responsible of deciding when the ad must be shown and implement the required logic.

Below you can find a simple integration example:

import UIKit
import WortiseSDK

class ViewController: UIViewController {

    private var appOpenAd: WAAppOpenAd!

    override func viewDidLoad() {
        super.viewDidLoad()
        ...
        appOpenAd = WAAppOpenAd(adUnitId: "test-app-open")
        appOpenAd.loadAd()
    }

    override func willMove(toParent controller: UIViewController?) {
        super.willMove(toParent: controller)
        ...
        appOpenAd.destroy()
    }
    
    func showAppOpen() {
        if appOpenAd.isAvailable {
            appOpenAd.showAd(from: self)
        }
    }
}

Also, the WAAppOpenAd class offers the following additional methods to configure its behaviour:

Via Manager

The SDK provides a standard implementation of App Open to facilitate the integration of this ad format.

To perform this kind of integration, it is needed to create an instance of WAAppOpenManager inside the AppDelegate class, just as shown in the example below:

With this simple integration, the app will show ads every time there is a transition from background to foreground.

Also, the WAAppOpenManager class offers the same methods as WAAppOpenAd to configure its behavior and show ads on demand.

Delegate configuration

Like occurs with other formats, a delegate can be set to receive the events that happen during the ad lifecycle. For this, it is needed to implement the WAAppOpenDelegate interface just as shown in the example below:

Once the interface is implemented, the delegate is assigned to the ad instance:

Última actualización