插屏廣告

插屏廣告

以下說明適用於 v4.0.0 以後的版本。

開始使用

建立插屏廣告(Interstitial)範例

ViewController.h

#import "AdbertADInterstitial.h"

@interface ViewController : UIViewController <AdbertADInterstitialDelegate>
@property(nonatomic, strong) AdbertADInterstitial *interstitial;

ViewController.m

//請輸入與 ADBERT 申請的 APPID 與 APPKEY
NSString *appID = @"";
NSString *appKey = @"";

self.interstitial = [[AdbertADInterstitial alloc] initWithAPPID:appID AndAPPKEY:appKey];
self.interstitial.delegate = self; // AdbertADInterstitialDelegate

//請求廣告,初始化廣告
[self.interstitial requestAD];
接收成功與 Show 廣告

ViewController.m

- (void)adbertADInterstitialDidReceiveAd:(AdbertADInterstitial *)interstitial {
    NSLog(@"# Adbert AD Interstitial ad did received.");
    [self.interstitial showAD];
}
接收失敗

ViewController.m

- (void)adbertADInterstitial:(AdbertADInterstitial *)interstitial didFailToReceiveAdWithError:(NSError *)error {
    NSLog(@"# Adbert AD banner ad did Fail.");
}
廣告已經到期

ViewController.m

- (void)adbertInterstitialDidExpire:(AdbertADInterstitial *)interstitial {
    NSLog(@"# Adbert AD interstitial ad did expire.");
}
廣告即將出現

ViewController.m

- (void)adbertInterstitialWillAppear:(AdbertADInterstitial *)interstitial {
    NSLog(@"# Adbert AD interstitial ad will appear.");
}
廣告已經出現

ViewController.m

- (void)adbertInterstitialDidAppear:(AdbertADInterstitial *)interstitial {
    NSLog(@"# Adbert AD interstitial ad did appear.");
}
廣告即將消失

ViewController.m

- (void)adbertInterstitialWillDisappear:(AdbertADInterstitial *)interstitial {
    NSLog(@"# Adbert AD interstitial ad will disappear.");
}
廣告已經消失

ViewController.m

- (void)adbertInterstitialDidDisappear:(AdbertADInterstitial *)interstitial {
    NSLog(@"# Adbert AD interstitial ad did disappear.");
}
廣告被點擊

ViewController.m

- (void)adbertInterstitialDidReceiveTapEvent:(AdbertADInterstitial *)interstitial {
    NSLog(@"# Adbert AD interstitial ad did receive tap event.");
}