在第四次单击后,间隙仅显示一次。是否有人可以在我想要的每一次点击时显示它(点击10次,点击20次...)
if ([self.interstitial isReady]) {
if (count > 4){
[self.interstitial presentFromRootViewController:self];
count = 0;
}
}
count += 1;发布于 2015-03-20 12:15:30
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;
}请在应用启动时获取此方法,这样您就可以随时随地设置多次跟随方法:
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
if ([appDelegate.interstitial isReady]) {
[appDelegate.interstitial presentFromRootViewController:self];
}https://stackoverflow.com/questions/29156528
复制相似问题