集成 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
一次又一次地调用,直到广告缓存成功..我觉得这很麻烦,而且很多广告最终可能会被缓存导致内存问题..有更好的方法吗?