App Open

This guide is intended for publishers integrating app open ads.

App open ads are a special ad format for publishers who want to load ads on app launch. App open ads can be closed by your users at any time. Here is an example of what an app open ad looks like:

At a high level, here are the steps required to implement app open ads:

  • Add methods to your AppDelegate to load and display an app open ad

  • Handle presentation callbacks.

Prerequisites

Always test with test ads

When building and testing your apps, make sure you use test ads rather than live, production ads. Failure to do so can lead to suspension of your account. The easiest way to load test ads is to use our dedicated test ad unit ID for app open ads:

63a57390cf26c

It's been specially configured to return test ads for every request, and you're free to use it in your own apps while coding, testing, and debugging. Just make sure you replace it with your own ad unit ID before publishing your app.

Modify your app delegate

App open ads are shown when your application launches. To make sure you have an ad ready to display when a user opens your app, you'll want to have a reference to an ad ready to use.

That means you must preload an ad before you need to show the ad. That way, your app open ad is ready to show the next time the app is opened. To facilitate having a single reference to the ad, add the methods to your AppDelegate.m:

func requestAppOpenAd() {
    //userId 
    Adx3FullScreenAd.sharedManager().load(withPlacementID: "Your Placement ID", userId: "", delegate: self)
}

This method initiates a request to load a new ad so that the user has an ad available when they launch your app.

Handle request callbacks

You should rely on the Adx3AdLoadingDelegate (optional) to handle request events, methods as below:

func didFinishLoadingAD(withPlacementID placementID: String!) {
    print("----\(placementID!)----")
}
    
func didFailToLoadAD(withPlacementID placementID: String!, error: Error!) {
    print("----\(error.debugDescription)----")
}

Add a method to display the ad.

func tryToPresentAd() {
    if Adx3FullScreenAd.sharedManager().fullScreenIsReady() {
        Adx3FullScreenAd.sharedManager().showScreenView(withContrller: self, delegate: self) { isSuccess in
                
        };
    }else {
        self.requestAppOpenAd()
    } 
}

This method checks the presence of an ad, and if it exists and is able to be shown from your root view controller, it will present the ad over your existing content. If no ad is available the method makes a new request.

Handle display callbacks

You should rely on the Adx3FullScreenDeleagte (optional) to handle display events, methods as below:

func fullScreenDidStartPlayingVideo(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
        
}
    
func fullScreenDidEndPlayingVideo(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
        
}
    
func fullScreenDidFailToPlayVideo(forPlacementID placementID: String!, error: Error!, extra: [AnyHashable : Any]!) {
        
}
    
func fullScreenDidClose(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
        
}
    
func fullScreenDidClick(forPlacementID placementID: String!, extra: [AnyHashable : Any]!) {
        
}

Last updated