在测试模式下从AdMob接收制作广告和插页式广告

时间:2013-03-28 10:47:48

标签: ios admob interstitial

我正在iOS应用程序中测试AdMob广告。 AdMob似乎忽略了我在代码中放置的测试标志:

-(IBAction)quitButtonHit:(id)sender{
    [[AudioPlayer sharedManager] stopSound];
    [self.timer invalidate];
    interstitial_ = [[GADInterstitial alloc] init];
    interstitial_.adUnitID = adMobUnitID;
    interstitial_.delegate = self;
    GADRequest *request = [GADRequest request];
    request.testing = YES;
    [interstitial_ loadRequest:[GADRequest request]];
}

-(void) interstitial:(GADInterstitial *)ad didFailToReceiveAdWithError:(GADRequestError *)error {
   [self dismissViewControllerAnimated:YES completion:nil];
}

-(void) interstitialDidDismissScreen:(GADInterstitial *)ad {
    [self dismissViewControllerAnimated:YES completion:nil];
}

-(void) interstitialDidReceiveAd:(GADInterstitial *)ad {
    [ad presentFromRootViewController:self];
}

当我点击我的应用中的退出按钮时,我收到了制作插页式广告。我不明白为什么,因为Google声明他们会邀请您接收插页式广告,因为我在请求中设置了测试标记。

我也在我的应用的AdMob横幅广告中收到制作广告。但这只适用于我的设备 - 在模拟器上显示测试广告。我还在申请横幅时设置了测试标志。

我希望制作广告能够消失,所以我不必担心会偶然使用它们。

我使用AdMob的lates API(版本6.3.0)。我的部署目标是iOS 6.0。

任何人都可以解释这一点,并建议一个解决方案,让制作广告消失吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

试试这个:

request.testDevices =
      [NSArray arrayWithObjects:
          // TODO: Add your device/simulator test identifiers here. They are
          // printed to the console when the app is launched.
          nil];

希望这会对你有所帮助。

一切顺利!!!