[英]IOS Admob interstitial on button click?
第四次点击后,插页式广告仅显示一次。 有人可以显示例如我想要的每一次点击(第10次点击,第20次点击...)
if ([self.interstitial isReady]) {
if (count > 4){
[self.interstitial presentFromRootViewController:self];
count = 0;
}
}
count += 1;
if ([self.interstitial isReady]) {
[self.interstitial presentFromRootViewController:self];
}
- (GADInterstitial *)createAndLoadInterstitial
{
GADInterstitial *interstitial = [[GADInterstitial alloc] init];
interstitial.adUnitID = @"ca-app-pub-yourAdId";
interstitial.delegate = self;
[interstitial loadRequest:[GADRequest request]];
return interstitial;
}
请在应用程序启动时获取此方法,然后您可以在各处多次设置follow方法:
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
if ([appDelegate.interstitial isReady]) {
[appDelegate.interstitial presentFromRootViewController:self];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.