swift - 横幅广告仅在应用程序首次启动时显示
问题描述
我在我的游戏中实现了 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
我已经研究了很长时间,但我找不到任何解决方案。
解决方案
你做了第2步吗?
要在此设备上获取测试广告,请调用:request.testDevices = @[ @"2077ef9a63d2b398840261c8221a0c9b" ];
您需要确保添加您的设备 UUID。
https://developers.google.com/admob/ios/test-ads
如果找不到您的 UUID,请参阅:https ://bjango.com/help/iphoneudid/
有多种获取 UUID 的方法,这只是其中一种。
推荐阅读
- assembly - 在 qemu 中将扇区加载到 RAM
- c++ - 使用 gcc 编译失败,但使用 msc++ 编译成功
- powershell - 如何在powershell中向异步作业添加回调函数并获取返回数据
- pygame - 为什么我会收到此 PEP 警告?
- objective-c - 如何制作多个单选按钮,但始终只选择一个,而第一个是默认的?
- sql - 如何使用 .NET Core 中的不同端口连接 SQL Server?
- database - 如何在猫鼬中创建嵌套模式
- office365 - 如何在 MS Project Online 中为 Web 项目创建项目?
- jquery - 在 Google 图表数组中插入一个 Jquery 变量号
- sql - 如何整理 SQL*Plus 布局?