ios - Chartboost 插页式 : "not in the window hierarchy!" warning

标签 ios iphone objective-c ipad chartboost

在 iOS 上,当我显示 Chartboost 插页式广告时,当我点击插页式广告时,“有时”(是的.. 并非所有时间)出现以下消息:

Warning: Attempt to present on whose view is not in the window hierarchy!

我只是这样调用 Chartboost:

[[Chartboost sharedChartboost] showInterstitial:CBLocationGameOver];

在启动时我缓存了这个插页式广告:

[[Chartboost sharedChartboost] cacheInterstitial:CBLocationGameOver];

这个问题我真的不懂。而且不是所有的时间。我无法解释和理解为什么有时它会起作用(当我触摸插页式广告时,我打开了 App Store)以及为什么有时插页式广告就消失了,什么也没有发生。

我从 3 或 4 个月开始就尝试向 Chartboost 询问这个问题,但我从来没有得到一个好的答案。

最佳答案

您应该指定 Chartboost 显示广告的 View 。为此,有一个方法调用:

[[Chartboost sharedChartboost] setRootView:YOUR_VIEW];

通过这句话,您可以让 Chartboost 在特定 View 中显示广告。

你应该在调用“showInterstitial”之前调用这个

更新:

在 SDK 5.0 版本中,他们改变了这种方法。现在你应该使用

[Chartboost showInterstitial:{view Controller} location:CBLocationHomeScreen];

但对于某些版本,此方法不会出现在 Chartboost.h 文件中。如果是这种情况,只需在此文件中添加以下行:

+ (void)showInterstitial:(UIViewController *)viewController
            location:(CBLocation)location;

关于ios - Chartboost 插页式 : "not in the window hierarchy!" warning,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24139244/

相关文章:

ios - 在连接的两端执行相同的身份验证数学

ios - 通过在 textField Swift 中点击文本来识别文本

ios - 如何更改 UITableViewCell 的高度?

iphone - 如何编辑 AUGraph 的默认工具?

ios - IOS中如何显示通知

iphone - Authorize.net ios Sdk 错误

ios - Cocoapod : "The document could not be saved. The file doesn’ t exist"的 Xcode 错误

jquery - 您可以删除特定设备的样式表吗?

ios - 在 Objective-C 的 TableView 中给出没有任何部分的部分索引以对单个 NSArray 进行排序?

ios - Firebase Dynamic Link 无法直接打开应用