5

我无法在我的应用中接收移动添加。

我的代码在这里:-

-(void) createMObAdds 
{
    bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];

     // Specify the ad unit ID.
     bannerView_.adUnitID = @"d81cb38a93cc479";
     bannerView_.rootViewController = self;
 [self.view addSubview:bannerView_];

 // Initiate a generic request to load it with an ad.
     [bannerView_ loadRequest:[GADRequest request]];
}

- (GADRequest *)request 
{
   GADRequest *request = [GADRequest request];
   request.testDevices = @[GAD_SIMULATOR_ID];
   [request setTesting:YES];
   return request;
}

- (void)adViewDidReceiveAd:(GADBannerView *)adView {
   NSLog(@"Received ad successfully");
}

- (void)adView:(GADBannerView *)view didFailToReceiveAdWithError:(GADRequestError *)error {
   NSLog(@"Failed to receive ad with error: %@", [error localizedFailureReason]);
}

但我收到错误:请求错误:发生网络错误。请让我知道我的代码中的问题在哪里或我需要做什么?

4

1 回答 1

0

请参阅下面的谷歌开发者链接,它会一步一步地指导你

谷歌开发者 AdMob 指南

希望它对你有帮助

于 2013-12-04T11:49:26.307 回答