//
//  InterstitialViewController.m
//  AdViewSDKDemo
//
//  Created by unakayou on 11/1/19.
//  Copyright © 2019 AdView. All rights reserved.
//

#import "InterstitialViewController.h"

@interface InterstitialViewController () <AdViewViewDelegate>
@property (nonatomic, strong) AdViewView * interstitial;
@end

@implementation InterstitialViewController

- (void)requestButtonClick:(UIButton *)sender {
    self.interstitial = [AdViewView requestAdInterstitialWithPositionId:@"POSIDajpz3chwo1q2"
                                                               delegate:self];
}

- (NSString *)appId {
    return ADVIEW_APPID;
}

- (UIViewController *)viewControllerForShowModal {
    return self;
}

- (BOOL)logMode {
    return YES;
}

- (void)didReceivedAd:(AdViewView *)adView {
    [adView showInterstitialWithRootViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}

- (void)didFailToReceiveAd:(AdViewView *)adView Error:(NSError *)error {
    NSLog(@"%s - %@",__FUNCTION__, error.domain);
}
@end
