首页 > 解决方案 > 横幅广告仅在应用程序首次启动时显示

问题描述

我在我的游戏中实现了 AdMob 框架,并使用横幅广告和插页式广告。插页式广告效果很好,但横幅广告仅在我删除游戏并首次启动时才会显示。此外,当我第一次启动应用程序时,我在控制台中收到此消息:

2018-08-06 21:34:53.778721+0200 game_name[12227:3101070] <Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.

但是当我重新启动应用程序时,横幅广告不再显示,并且我在控制台中收到很多(大约 10 条)这样的错误消息:

2018-08-06 21:23:40.020162+0200 game_name[12216:3098401] WF: _userSettingsForUser mobile: {
    filterBlacklist =     (
    );
    filterWhitelist =     (
    );
    restrictWeb = 1;
    useContentFilter = 0;
    useContentFilterOverrides = 0;
    whitelistEnabled = 0;
}

还有一些像这样的错误消息:

2018-08-06 21:23:36.079086+0200 game_name[12216:3098395] ADD: failed to create cache dictionary at path=/private/var/mobile/Containers/Data/Application/2CC7FA65-F793-45FA-BD7D-56F1BF847705/Library/Caches/my_name.game_name. key=0x282602b50

我已经研究了很长时间,但我找不到任何解决方案。

标签: swiftxcodesprite-kitadmob

解决方案


你做了第2步吗?

要在此设备上获取测试广告,请调用:request.testDevices = @[ @"2077ef9a63d2b398840261c8221a0c9b" ];

您需要确保添加您的设备 UUID。

https://developers.google.com/admob/ios/test-ads

如果找不到您的 UUID,请参阅:https ://bjango.com/help/iphoneudid/

有多种获取 UUID 的方法,这只是其中一种。


推荐阅读