我制作了一个包含insterstitials pubs的应用程序(Ios)。当我测试开发版本时,我看到了展示广告(酒吧告诉我我已经连接到iAd)。 我把它放在苹果商店,似乎没有酒吧。我在4台设备上测试过并且没有显示任何一个酒吧......
以下是代码:
ADInterstitialAd * pub;
BOOL requestingAd;
-(void)showFullScreenAd {
NSLog(@"%d",requestingAd);
//Check if already requesting ad
pub = nil;
requestingAd = NO;
pub = [[ADInterstitialAd alloc] init];
pub.delegate = self;
self.interstitialPresentationPolicy = ADInterstitialPresentationPolicyManual;
[self requestInterstitialAdPresentation];
NSLog(@"interstitialAdREQUEST");
requestingAd = YES;
}
-(void)interstitialAd:(ADInterstitialAd *)interstitialAd didFailWithError:(NSError *)error
{
pub = nil;
requestingAd = NO;
NSLog(@"interstitialAd didFailWithERROR");
NSLog(@"%@", error);
}
-(void)interstitialAdDidLoad:(ADInterstitialAd *)interstitialAd {
NSLog(@"interstitialAdDidLOAD");
if (interstitialAd != nil && pub != nil && requestingAd == YES) {
[pub presentFromViewController:self];
NSLog(@"interstitialAdDidPRESENT");
}//end if
}
-(void)interstitialAdDidUnload:(ADInterstitialAd *)interstitialAd {
pub = nil;
requestingAd = NO;
NSLog(@"interstitialAdDidUNLOAD");
}
-(void)interstitialAdActionDidFinish:(ADInterstitialAd *)interstitialAd {
pub = nil;
requestingAd = NO;
NSLog(@"interstitialAdDidFINISH");
}
然后我打电话给“showFullScreenAd”。 通常代码运行良好。在模拟器和iPad上,它运行良好。
你知道这个问题的根源吗?
提前感谢您的帮助