-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Only tested on Android and with RewardVideos but my guess is that the same problem is with showInterstitial function.
isLoaded must be called on the main UI thread
is thrown when calling showRewardVideoAd().
@PluginMethod() public void showRewardVideoAd(PluginCall call) { try { if (mRewardedVideoAd.isLoaded()) { getActivity().runOnUiThread(new Runnable() { @Override public void run() { mRewardedVideoAd.show(); } }); call.success(new JSObject().put("value", true)); }else { call.error("The RewardedVideoAd wasn't loaded yet."); } }catch (Exception ex) { call.error(ex.getLocalizedMessage(), ex); } }
Maybe its possible to wrap isLoaded within a new Runnable and setting the PluginCall call
to final
to access the param? Or having a new method that returns mRewardedVideoAd.isLoaded()
, that could be useful in more cases probably.