nativescript-webview-interface icon indicating copy to clipboard operation
nativescript-webview-interface copied to clipboard

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

Open san18793 opened this issue 6 years ago • 6 comments

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.

san18793 avatar Jun 15 '18 13:06 san18793

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

bradrice avatar Jul 05 '18 15:07 bradrice

Any news on this issue? Having the same problem.

appdevsa avatar Nov 08 '18 03:11 appdevsa

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

phatakrajan avatar Jan 09 '19 13:01 phatakrajan

I too, any updates here?

d-a-p-h avatar Feb 18 '19 04:02 d-a-p-h

@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.

phatakrajan avatar Feb 18 '19 04:02 phatakrajan

@phatakrajan thank you

d-a-p-h avatar Feb 18 '19 05:02 d-a-p-h