-
Notifications
You must be signed in to change notification settings - Fork 6
Implementation for interstitial ads
Please refer to the link below if you have not downloaded the SDK or created an ad space.
If you have not added the SDK into the Project, please add it by the following methods.
First, send loadAdWithSpotID:apiKey: to NADInterstital and load the ad.
※We recommend implementing the load processing after the app runs.
Ex. UIApplicationDelegate Protocol is implemented application:didFinishLaunchingWithOptions: etc.
Swift
import UIKit
import NendAd
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
// NADInterstitial Implement with a single pattern
// sharedInstance You can retrieve the Instance via Message like below
NADInterstitial.sharedInstance().loadAd(withSpotID: spotID, apiKey: "apiKey")
return true
}
}Objective-C
#import <NendAd/NADInterstitial.h> // Import the Header File
@implementation YourAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
[[NADInterstitial sharedInstance] loadAdWithSpotID:spotID apiKey:@"apiKey"];
return YES;
}
@endThrough the use of NADInterstitial[XXX]Delegate (e.g Loading, Click), you can listen for these events are fired. For more information, please refer to Property, NADInterstitialLoadingDelegate and NADInterstitialClickDelegate of the Information on NADInterstital Content.
By sending showAdFromViewController:, you can display ads. Set UIViewController in the ad you want to display to the parameter and send a message.
Please note that if the ad is not completely read, then the interstitial ad will not be displayed.
The ad will not display if you click on the X button on the top right or anywhere outside the ad. If you tap in the banner ad or install ad, it will take you to the App Store.

Regarding the content of the return value of NADInterstitialShowResult, please refer to the sample code below.
Swift
import UIKit
import NendAd
class YourOriginalClass: UIViewController {
func showButtonClicked(_ sender: UIButton) {
let showResult = NADInterstitial.sharedInstance().showAd(from: self)
switch (showResult) {
case .AD_SHOW_SUCCESS:
print("Ad is displayed successfully")
break
case .AD_SHOW_ALREADY:
print("Ad has already displayed successfully")
break
case .AD_FREQUENCY_NOT_REACHABLE:
print("The frequency cap has not been reached ")
break
case .AD_LOAD_INCOMPLETE:
print("Ad has not been loaded or in the process of loading ")
break
case .AD_REQUEST_INCOMPLETE:
print("Ad request has failed")
break
case .AD_DOWNLOAD_INCOMPLETE:
print("Ad has not finished downloading ")
break
case .AD_CANNOT_DISPLAY:
print("Ad cannot be displayed in the designated ViewController ")
break
@unknown default:
break
}
}
}Objective-C
#import <NendAd/NADInterstitial.h> // Import the header file
@implementation YourOriginalClass : UIViewController
- (void)showInterstitialAdSample
{
NADInterstitialShowResult result = [[NADInterstitial sharedInstance] showAdFromViewController:self];
switch (result) {
case AD_SHOW_SUCCESS:
NSLog(@"Ad is displyed successfully");
break;
case AD_SHOW_ALREADY:
NSLog(@"Ad has already displayed successfully");
break;
case AD_FREQUENCY_NOT_REACHABLE:
NSLog(@"The frequency cap has not been reached");
break;
case AD_LOAD_INCOMPLETE:
NSLog(@"Ad has not been loaded or in the process of loading");
break;
case AD_REQUEST_INCOMPLETE:
NSLog(@"Ad request has failed");
break;
case AD_DOWNLOAD_INCOMPLETE:
NSLog(@"Ad has not finished downloading");
break;
case AD_CANNOT_DISPLAY:
NSLog(@"Ad cannot be displayed in the designated ViewController");
break;
}
}
@endYou can stop displaying ads by sending dismissAd to the NADInterstitial Class.
Swift
import UIKit
import NendAd
class YourOriginalClass: UIViewController {
func dismissInterstitialAdSample(){
NADInterstitial.sharedInstance().dismissAd()
}
}Objective-C
#import <NendAd/NADInterstitial.h> // import the header file
@implementation YourOriginalClass : UIViewController
- (void)dismissInterstitialAdSample
{
[[NADInterstitial sharedInstance] dismissAd];
}
@end-
v7.0.4 以降のバージョンから SKAdNetwork を使用した広告配信を行っております。最新版のSDKへのアップデートを推奨します。
更新履歴はこちらを参照ください。 -
iOS14以降では、広告の効果を測定するためにアプリに追加の設定を行う必要があります。
詳細はこちらを参照ください。 -
2023年9月1日より、SDK v6.0.0未満では動画広告の配信を停止いたします。新しいバージョンのご利用をご検討ください。
-
We recommend updating to latest version. v7.0.4 or higher it using advertise SKAdNetwork.
For details, please Release Notes. -
Need to configure the app for ad conversion tracking for iOS14.
For details, please check here. -
Effective September 1, 2023, we will stop serving video ads with SDK under v6.0.0. Please consider using a newer version.
- バナー型広告
- インタースティシャル広告
- ネイティブ広告
- フルボード広告
- 動画広告
- 動画ネイティブ広告
- Release Notes
- Preparation
- Supported Environments
- nendSDK Data Collection Items
- Privacy Policy
- About Information Button
- Add Manually
- Use CocoaPods
- Preparing for iOS14 or later
- When updating from nendSDK before version 3.2.2
- Banner Ad
- Interstitial Ad
- Native Ad
- Fullscreen Ad
- Video Ad
- Native Video Ad