iOS fullscreen interstitial ad implementation

Full screen interstitial advertisement is a full page advertisement displayed when the screen is switched by operation of the application, screen transition, etc. By displaying advertisements on screen transition, visibility of users can be improved. You can also return to the original transition screen by pressing the X button(close button).

For Geniee SDK, mediation adapter displays fullscreen interstitial advertisements of each 3rd ad network.

Preparing to install

To prepare for implementation of native ads, please follow the guide below. You need to install Geniee SDK to your project. Start Guide

  • SDK for each ad network, adapters The following settings are required for FullscreenInterstitial.
  1. Setting of SDK for each ad network
  2. Adapter setting is required.

Refer to the installation method from the link below.

Ad network Version
maio 1.4.0
AppLovin 5.1.1
Nend 5.0.2
Zucks 4.7.8
Tapjoy 12.0.0
UnityAds 2.3.0
Vungle 6.2.0
i-mobile 2.0.29

Sample project

Objective-C

https://github.com/geniee-ssp/Geniee-iOS-SDK/tree/master/sample/use_cocoapods/objectivec

Swift

https://github.com/geniee-ssp/Geniee-iOS-SDK/tree/master/sample/use_cocoapods/swift

Classes & protocols

The following classes are used for iOS rewarded video delivery. GNSRequest.h GNSFullscreenInterstitialAd.h GNSFullscreenInterstitialAdDelegate.h

Implementation

Import header file and add Delegate

Example:ViewController.h

#import <GNAdSDK/GNSFullscreenInterstitialAd.h>
#import <GNAdSDK/GNSRequest.h>
#import <GNAdSDK/GNSFullscreenInterstitialAdDelegate.h>
@interface ViewController <GNSFullscreenInterstitialAdDelegate>
1
2
3
4

Delegate method implementation

  • This implementation is optional.

In the FullsceenInterstitial Ad SDK, set Delegate.

If you want to handle the following delgate, please implement delgate in ViewController which receives callback. If you describe it in viewDidLoad, viewDidLoad will not be executed after screen transition, delegate may not be set in some cases. The life cycle of iOS is involved.

Example:Viewcontroller.m (viewWillAppear recommended)

viewWillAppeare(){
    [GNSFullscreenInterstitialAd sharedInstance].delegate = self;
}
1
2
3

To receive notification from the SDK, implement the method of GNSFullscreenInterstitialAdDelegate

Example:Viewcontroller.m

/// Define failure to load ads in delegates.
- (void)fullscreenInterstitial:(GNSFullscreenInterstitialAd *)fullscreenInterstitialAd
    didFailToLoadWithError:(NSError *)error {
}

/// Define successfully to load ad with delegate.
- (void)fullscreenInterstitialDidReceiveAd:(GNSFullscreenInterstitialAd *)fullscreenInterstitialAd {
}

/// Define show ads in the delegate.
(void)fullscreenInterstitialWillPresentScreen:(GNSFullscreenInterstitialAd *)fullscreenInterstitialAd {
}

/// Define that a delegate will close ad.
- (void)fullscreenInterstitialAdDidClose:(GNSFullscreenInterstitialAd *)fullscreenInterstitialAd {
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Load fullscreen interstitial ad load

Set load request to ZoneID (App ID) and request ad load.

Note:

Load requests can take several seconds or more, so loadRequest fullscreen interstitial ads early in the application lifecycle.

If you want to display another ad after an ad has been presented, you will need to run loadRequest again.

GNSRequest *request = [GNSRequest request];    
[[GNSFullscreenInterstitialAd sharedInstance] loadRequest:request
                                       withZoneID:@"YOUR_SSP_ZONE_ID"];
1
2
3

Display fullscreen interstitial

Make sure the ad has ready to display.

if ([[GNSFullscreenInterstitialAd sharedInstance] canShow]) {
   [[GNSFullscreenInterstitialAd sharedInstance] show:self];
}
1
2
3

Implementation method to display advertisement with higher unit price than

By displaying advertisements after several tens of seconds from the ad ready event, we may increase unit price. This is because, when requesting a plurality of advertisements at the same time to prepare the first advertisement, the application side is notified of the preparation completion, and there is a possibility that the advertisement with a higher unit price becomes ready in a few seconds thereafter That is why. Therefore, by receiving the advertisement acquisition process in advance, it is possible to acquire a higher unit price advertisement.

Last Updated: 4/10/2019, 3:58:31 PM