ios - 无法接收 Google 移动添加

标签 ios iphone adview

我无法在我的应用中接收移动广告。

我的代码在这里:-

-(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]);
}

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

最佳答案

请参阅下面的 Google Developer Link,它会逐步指导您

Google Developer AdMob Guide

希望对你有帮助

关于ios - 无法接收 Google 移动添加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20372066/

相关文章:

ios - 使用 count() 时 swift 出现奇怪的错误

ios - 将键/值存储在 NSDictionary/NSCache 中,它保留数据直到应用程序终止

iphone - 我无法捕获 FMDB 空结果集

android - 将自定义广告尺寸与 PublisherAdView 结合使用时,Google 广告不可见

ios - iphone 开发 - 数据持久化 UI

ios - OpenGL ES 2.0 球体

android - Webview 中的 Java 空指针异常

android - RecyclerView 和 NestedScrollView 底部的 Admob

iphone - 停止 CAAnimation 以添加另一个 CAAnimation

iphone - 如何制作 iPhone/iPad 上可滚动的半圆形菜单?