FullscreenInterstitial For iOS english - unigeniee/Geniee-iOS-SDK GitHub Wiki

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.3.0
AppLovin 5.0.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>

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;
}

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 {
}

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"];

Display fullscreen interstitial

Make sure the ad has ready to display.

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