shripalsoni04 / nativescript-webview-interface

Plugin for bi-directional communication between webView and android/ios
MIT License
89 stars 35 forks source link

Found issue when rotate screen on Android device, Emulator #13

Open ghost opened 7 years ago

ghost commented 7 years ago

As a title I found this issue when I rotate screen on my Android Device and Emulator.

ERROR : W/System.err(31716): Frame: function:'WebViewInterface._executeJS', file:'file:///data/data/com.xxxx.xxx/files/app/tns_modules/nativescript-webview-interface/index.js', line: 64, column: 29 W/System.err(31716): Frame: function:'WebViewInterface.callJSFunction', file:'file:///data/data/com.xxxx.xxx/files/app/tns_modules/nativescript-webview-interface/index-common.js', line: 164, column: 10 W/System.err(31716): at com.tns.Runtime.callJSMethodNative(Native Method) W/System.err(31716): at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1197) W/System.err(31716): at com.tns.Runtime.callJSMethodImpl(Runtime.java:1061) W/System.err(31716): at com.tns.Runtime.callJSMethod(Runtime.java:1047) W/System.err(31716): at com.tns.Runtime.callJSMethod(Runtime.java:1028) W/System.err(31716): at com.tns.Runtime.callJSMethod(Runtime.java:1018)

  1. I have set application.on(application.orientationChangedEvent, self.orientationChange.bind(this));
  2. So, when rotate screen it will trigger function orientationChange.
  3. After that in function orientationChange will have this line :

this.webViewPlayerInterface.callJSFunction('xxx', [data]);

which is using for trigger function xxx in my web view to do something.

One thing that weird is sometime this issue will happen but sometimes not.

Pls help to suggest on this.

Thank you