EddyVerbruggen / nativescript-admob

NativeScript plugin to earn some precious :moneybag::moneybag: with ads by Google AdMob
MIT License
69 stars 26 forks source link

onAdClosed problem #24

Closed oncul closed 6 years ago

oncul commented 7 years ago

Hi, when you close app before full screen ad loaded. And when i reopen app and fullscreen ad apperas. If i close ad its returning this error.

com.tns.NativeScriptException: Calling js method onAdClosed failed
TypeError: Cannot read property 'setAdListener' of null
File: "file:///data/data/com.ttt.mmm/files/app/tns_modules/nativescript-admob/admob.js, line: 162, column: 32
StackTrace:
Frame: function:'onAdClosed', file:'file:///data/data/com.ttt.mmm/files/app/tns_modules/nativescript-admob/admob.js', line: 162, column: 33
  at com.tns.Runtime.callJSMethodNative(Native Method:0)
  at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021)
  at com.tns.Runtime.callJSMethodImpl(Runtime.java:903)
  at com.tns.Runtime.callJSMethod(Runtime.java:890)
  at com.tns.Runtime.callJSMethod(Runtime.java:874)
  at com.tns.Runtime.callJSMethod(Runtime.java:866)
  at com.tns.gen.com.google.android.gms.ads.AdListener_fes_app_tns_modules_nativescript-admob_admob_l153_c74__.onAdClosed(com.google.android.gms.ads.AdListener.java:0)
umair-ameen commented 6 years ago

@cagatayoncul I am facing the same issue. Have you found any solution?

EddyVerbruggen commented 6 years ago

I was never able to reproduce this issue, but I've added a guard to prevent this from happening nonetheless. Available now in 1.4.3.