集成SponsorPay/Fyber间隙广告时,如何检查广告何时可用?他们提供了以下示例代码:
- (void)interstitialClient:(SPInterstitialClient *)client
canShowInterstitial:(BOOL)canShowInterstitial
{
// Assuming that this is a subclass of UIViewController
// and that we want to show an interstitial immediately
if (canShowInterstitial) {
[client showInterstitialFromViewController:self];
} else {
// maybe try later
}
}
但是canShowInterstitial总是返回NO,所以我需要一次又一次地调用checkInterstitialAvailable,直到广告被成功缓存。我觉得这很麻烦,而且很多广告最终都会被缓存导致内存问题..有更好的方法吗?
发布于 2015-03-11 17:12:42
您的代码片段没有任何问题。正如您在documentation中看到的那样,这是当前显示间隙广告的正确方式
Fyber的Interstitial目前只适用于中介,也就是广告网络,因此问题可能来自于您正在集成的网络。
也不应该有内存问题,因为在接收到新广告之前缓存的和未使用的所有数据都会被准确地丢弃,以防止出现这种问题
https://stackoverflow.com/questions/27657672
复制相似问题