#import "ViewController.h"
@import AdWhaleSDK;
@interface ViewController () <AdWhaleInterstitialDelegate>
@property (nonatomic, strong) AdWhaleInterstitialAd *interstitialAd;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
// Interstitial Ad Setting
AdWhaleInterstitialAd *interstitial = [[AdWhaleInterstitialAd alloc] init];
interstitial.interstitialDelegate = self;
// Interstitial Ad Request
[interstitial load:@"전면 광고 AD_UNIT_ID 입력"];
}
- (IBAction)interstitialAdShow:(id)sender {
NSLog(@"interstitial Ad Show");
[interstitialAd show:self];
}
#pragma mark - InterstitialAd Delegate
- (void)adDidReceiveInterstitialAd:(AdWhaleInterstitialAd *)ad {
NSLog(@"adWhale Sample adDidReceiveInterstitialAd");
interstitialAd = ad;
}
- (void)adDidFailToReceiveInterstitialAdWithError:(NSError *)error {
NSLog(@"adWhale Sample adDidFailToReceiveInterstitialAdWithError");
}
- (void)ad:(AdWhaleInterstitialAd *)ad didFailToPresentInterstitialAdWithError:(NSError *)error {
NSLog(@"adWhale Sample didFailToPresentInterstitialAdWithError: %@", error);
}
- (void)adWillPresentInterstitialAd:(AdWhaleInterstitialAd *)ad {
NSLog(@"adWhale Ad will present Interstitial ad.");
}
- (void)adDidDismissInterstitialAd:(AdWhaleInterstitialAd *)ad {
NSLog(@"adWhale Ad did dismiss Interstitial ad.");
}
@end