HTML5 LocalStorage

Hi!

I´m trying to use HTML5 LocalStorage with newWebView component in iOS, but it´s not working either in simulator or device.

Is it supported or must i look for a workaround?

In that case, any idea about passing messages between webView content and lua app?

thx!

HTML 5 local storage should be supported in the webView, but only for the webView.  There is no way that I know of for your Lua code to access the newWebView’s data space.  It’s sort of a black box.

Thank you for the quick answer Rob.

I tried with WebPopup and newWebView but nothing. The html localStorage is working outside (chrome and safari), but when i use it inside the app it is not stored…

I also tried a simple xcode project with an UIWebview and also retrieves the stored values without problem.

Is there something i must put in config ? Maybe the dispose code?

this is the way i use the webview

  visor = native.WebView( 0, 166, 1537, 1879 ) 

  visor:request( hurl, system.ResourceDirectory ) 

I also tried moving html to the DocumentsDirectory just in case, but nothing.

And the dispose code

visor:removeSelf(); visor = nil

Thank you very much for the help

Are you testing this in the Simulator? (What version of Corona SDK?) or are you trying it on device?  If so what device/operating system?

Hi!

OS X 10.8.5

Corona 2013.1202

Tested in simulator and iPad 1 with 5.1.1

I already found a workaround for my problem: passing urls with jquery inside the webview , catching de event in Corona event listener and writing back the data in json file ( using your useful table save and load json table :slight_smile: … where the html file in the webview read it back when the session is restored.

Little tricky but…works.

Thank you again for your help.

miguel

HTML 5 local storage should be supported in the webView, but only for the webView.  There is no way that I know of for your Lua code to access the newWebView’s data space.  It’s sort of a black box.

Thank you for the quick answer Rob.

I tried with WebPopup and newWebView but nothing. The html localStorage is working outside (chrome and safari), but when i use it inside the app it is not stored…

I also tried a simple xcode project with an UIWebview and also retrieves the stored values without problem.

Is there something i must put in config ? Maybe the dispose code?

this is the way i use the webview

  visor = native.WebView( 0, 166, 1537, 1879 ) 

  visor:request( hurl, system.ResourceDirectory ) 

I also tried moving html to the DocumentsDirectory just in case, but nothing.

And the dispose code

visor:removeSelf(); visor = nil

Thank you very much for the help

Are you testing this in the Simulator? (What version of Corona SDK?) or are you trying it on device?  If so what device/operating system?

Hi!

OS X 10.8.5

Corona 2013.1202

Tested in simulator and iPad 1 with 5.1.1

I already found a workaround for my problem: passing urls with jquery inside the webview , catching de event in Corona event listener and writing back the data in json file ( using your useful table save and load json table :slight_smile: … where the html file in the webview read it back when the session is restored.

Little tricky but…works.

Thank you again for your help.

miguel