【问题标题】:iOS 7 Google AdMob not appearingiOS 7 Google AdMob 未出现
【发布时间】:2014-01-12 05:34:03
【问题描述】:

我正在尝试在应用程序上添加 AdMob 横幅。我正在使用 iOS 7 模拟器和 iPhone 设备。

我的代码如下:

-(GADRequest *)createRequest {
GADRequest *request = [GADRequest request];
request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATOR_ID, nil];
return request;
}

当我在 iPhone 5s 设备上运行它时,我在控制台中收到以下错误:

<Google> To get test ads on this device, call: request.testDevices = @[ @"7523f590b222af575517f669f4d63632" ];

<Google> Invalid Request: {
errors = "Cannot determine request type. Is your ad unit id correct?";
"google.afma.Notify_dt" = 1389504628864;
"request_id" = 1;
"request_scenario" = "offline_empty";
type = unknown;
"use_webview_loadurl" = 0;
}

如果我将代码更改为建议的内容,即

-(GADRequest *)createRequest {
GADRequest *request = [GADRequest request];
request.testDevices = @[ @"7523f590b222af575517f669f4d63632" ];
return request;
}

我收到完全相同的错误消息。

现在,当我在模拟器中运行它时,我会收到以下错误消息:

<Google> To get test ads on this device, call: request.testDevices = @[ GAD_SIMULATOR_ID ];

如果我将代码更改为 Google 建议的内容,即:

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

我再次收到相同的错误消息。 AdMob 和 iOS 7 有什么问题吗?我的实施有问题吗?我浏览了 AdMob 文档,一切都按照 Google 的建议进行。

希望有人可以帮助我。

非常感谢

【问题讨论】:

  • 你找到解决方法了吗,因为我遇到了同样的问题?

标签: ios iphone ios7 admob


【解决方案1】:

您需要将广告单元 ID 设置为 GADBannerView。

类似:

self.bannerView.adUnitID = @"your ad unit id from the admob site"

https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals#ios

【讨论】:

    【解决方案2】:

    首先,是的,设置您的发布商 ID

    第二个,重启(杀死)模拟器。

    它帮助了我很多次。

    在第 3 步中,如果 #2 没有帮助,请终止模拟器,选择另一个模拟设备并再次运行。 不知道为什么,但它也有帮助。 XCode 5

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多