how do I send data from webview to the corona app without using an ugly form submit button?
many thanks
how do I send data from webview to the corona app without using an ugly form submit button?
many thanks
I am wondering the same. Thanks!
I am wondering the same. Thanks!
Any new pointers regarding passing webview data/content back to corona/lua layer?
Cheers
There is not a good way to have a webView talk to Corona native code. You could write the JSON to a web server file and use network.download to download it.
Thanks for your reply Rob, however there isn’t a web server side. I am trying to extract the contents being loaded in the webview - which could be a third party website. Is there some way I can get the HTML contents loaded in the webview into the corona/lua code?
Many thanks.
You could network.download the HTML to a local file in your system.DocumentsDirectory (well system.CachesDirectory) and load it into a webView as a local file, then you could get the data using file IO as well.
Hi, My approach so far is adding json string in the url. The webView listener is fired with any url changes.
Any new pointers regarding passing webview data/content back to corona/lua layer?
Cheers
There is not a good way to have a webView talk to Corona native code. You could write the JSON to a web server file and use network.download to download it.
Thanks for your reply Rob, however there isn’t a web server side. I am trying to extract the contents being loaded in the webview - which could be a third party website. Is there some way I can get the HTML contents loaded in the webview into the corona/lua code?
Many thanks.
You could network.download the HTML to a local file in your system.DocumentsDirectory (well system.CachesDirectory) and load it into a webView as a local file, then you could get the data using file IO as well.
Hi, My approach so far is adding json string in the url. The webView listener is fired with any url changes.
Is it possible to write a file on the system.DocumentsDirectory with Corona and read it via a function in javascript loaded with native.newWebView (through an html file)?
My problem is how to get the path of the file in javascript stored in the system.DocumentsDirectory.
Not that I’m aware of.
Rob
Is it possible to write a file on the system.DocumentsDirectory with Corona and read it via a function in javascript loaded with native.newWebView (through an html file)?
My problem is how to get the path of the file in javascript stored in the system.DocumentsDirectory.
Not that I’m aware of.
Rob