我正在尝试将AdMob的插页式广告整合到我的iOS中,但即使一切似乎都没问题,我也没有获得任何插页式委托方法(包括失败).我已将广告设置为插页式广告,并且我的广告单元ID正确无误.这是我的代码:
GADInterstitial *interstitialAd = [[GADInterstitial alloc] init];
interstitialAd.adUnitID = AD_UNIT_ID;
interstitialAd.delegate = self;
GADRequest *adRequest = [GADRequest request];
#if DEBUG
adRequest.testDevices = @[ @"9ab869b041b0e1d5a362be13c99eb69a" ];
#endif
[interstitialAd loadRequest:adRequest];
Run Code Online (Sandbox Code Playgroud)
我在上面的代码中有一个断点,它正在解雇.然后,在同一个类中,我实现了委托方法:
-(void)interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error{
loadedAd = nil;
}
-(void)interstitialDidReceiveAd:(GADInterstitial *)ad{
loadedAd = ad;
[self presentAdIfAppropriate];
}
Run Code Online (Sandbox Code Playgroud)
但是,即使在等待几分钟之后,也没有调用这些方法.我的设备上有稳定的互联网连接,AdMob网站的连接超时设置为4秒.为什么我的广告没有加载?
| 归档时间: |
|
| 查看次数: |
1417 次 |
| 最近记录: |