Heyzap / heyzap-cordova

Heyzap SDK for Apache Cordova
https://www.heyzap.com/
10 stars 18 forks source link

Interstitial not fetched if app goes online later #22

Open rafaellop opened 7 years ago

rafaellop commented 7 years ago

It seems that the SDK doesn't try to fetch another interstitial if the initial FETCH_FAILED callback is fired.

I mean a case when an app is started in offline mode. The init tries to HeyzapAds.start(...) but if there's no network the FETCH_FAILED callback is fired and the SDK doesn't try again to fetch the interstitial. Even if the app goes online it doesn't try either.

However the docs say that the fetch() method for the InterstitialAd object doesn't have to be called manually. I would prefer this to be corrected in the docs that the fetch() method may be used to try to fetch a new interstitial after app goes online.

It's is indeed what I'm doing now, because the fetch() method is available for interstitials in the SDK. I discover the on/off line state change and if the app goes online I call fetch() on the InterstitialAd object. The callbacks works again and I can catch new FETCH_FAILED or AVAILABLE states and display a new interstitial.

So, TL;DR the docs should not say the fetch() on InterstitialAd doesn;t have to be used. It may be used in some cases, for example initialization of a new interstitial fetching after app goes online.

ekilah commented 7 years ago

This should be resolved.