You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.
Does anyone have a way to handle airplane mode or no connection available when using this library. Right now for example, my hook line is giving me unhandled promise rejection -> Error while connecting to ad server, when I cant connect to the internet and try to load this line: const { adLoadError, adLoaded, show, load, reward, adPresented, adDismissed } = useRewardedAd(TestIds.REWARDED );
I am not well versed with hooks and I'm not really sure how to go about resolving this or if I should take a different approach? Thanks.
The text was updated successfully, but these errors were encountered:
Hi, when error loads fail because internet is not available, adLoadError will be set. You can handle it by checking adLoadError is not undefined. Also, more preferred way is showing ad only if ad is loaded, using adLoaded value. If adLoaded value is true, show your ad, otherwise, just move to next screen.
Corresponding example can be found in Documentation.
Also, I found internal code does not handle promise rejection on the very first load if the ad is loaded automatically thus throws the warning. You can ignore the warning this time. I'll update code to remove the warning in the next version.
Does anyone have a way to handle airplane mode or no connection available when using this library. Right now for example, my hook line is giving me unhandled promise rejection -> Error while connecting to ad server, when I cant connect to the internet and try to load this line:
const { adLoadError, adLoaded, show, load, reward, adPresented, adDismissed } = useRewardedAd(TestIds.REWARDED );
I am not well versed with hooks and I'm not really sure how to go about resolving this or if I should take a different approach? Thanks.
The text was updated successfully, but these errors were encountered: