shripalsoni04 / nativescript-webview-interface

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

Unable to pass the values extra values from index.js to index.html in iOS real device #34

Open san18793 opened 6 years ago

san18793 commented 6 years ago

When I am trying to run my application in iOS real device after integrated the webview-interface and modified the index.html file with adding some elements and passing the data from index.js. I am getting error like this

CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:569:26: Unhandled Promise rejection: Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={WKJavaScriptExceptionLineNumber=1, WKJavaScriptExceptionMessage=TypeError: undefined is not an object (evaluating 'window.nsWebViewInterface._onNativeEvent'), WKJavaScriptExceptionColumnNumber=26, WKJavaScriptExceptionSourceURL=file:////var/mobile/Containers/Data/Application/43998519-0A7B-4DB9-87F6-98BB2F9D179B/Library/Application%20Support/LiveSync/app/www/index.html, NSLocalizedDescription=A JavaScript exception occurred} ; Zone: ; Task: null ; Value: Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={WKJavaScriptExceptionLineNumber=1, WKJavaScriptExceptionMessage=TypeError: undefined is not anobject (evaluating 'window.nsWebViewInterface._onNativeEvent'), WKJavaScriptExceptionColumnNumber

CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:571:22: Error: Uncaught (in promise): Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={WKJavaScriptExceptionLineNumber=1, WKJavaScriptExceptionMessage=TypeError: undefined is not an object (evaluating 'window.nsWebViewInterface._onNativeEvent'), WKJavaScriptExceptionColumnNumber=26, WKJavaScriptExceptionSourceURL=file:////var/mobile/Containers/Data/Application/43998519-0A7B-4DB9-87F6-98BB2F9D179B/Library/Application%20Support/LiveSync/app/www/index.html, NSLocalizedDescription=A JavaScript exception occurred}

But it is working fine in Android both emulator and real device. In iOS simulator also working fine I am getting error in iOS real device only.

bradrice commented 6 years ago

I too, can get it to work in the ios simulator, but not on the ios device.

appdevsa commented 6 years ago

Any news on this issue? Having the same problem.

phatakrajan commented 5 years ago

I am facing same issue.....any updates here?

d-a-p-h commented 5 years ago

I too, any updates here?

phatakrajan commented 5 years ago

@d-a-p-h This issue comes on iOS real device when you build app without certificates. If you run release version of the app on real iOS device, this issue should go away.

d-a-p-h commented 5 years ago

@phatakrajan thank you