shripalsoni04 / nativescript-webview-interface

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

iOs not communicating with index.js #39

Open rickdps opened 6 years ago

rickdps commented 6 years ago

First of all, thank you very much for this plugin. I'm sure this has helped a lot of people.

Here is my scenario:

I have 2 files, home.js and page2.js and a folder called www which contains two files, index.html and index.js. These are all inside the app folder.

Btw, this is a vanilla project.

I've imported the nativescript-webview-interface in page2.js which also has the code to trigger the functions that are defined in the index.js.

This setup is working perfectly on android, but it is not on iOS.

On iOS, I have noticed that when the emitEventToWebView() is run, it doesn't trigger the methods that are declared in the index.js

Any thoughts?

Please help me. :)

tdhman commented 5 years ago

@rickdps Hello, how do you run your code in web view, e.g. localhost with file:// ? Because in iOS, the webview have a restriction to load/execute local js file. That's why, you see the code in index.js does not get triggered.