I want to create one localstorage variable from my native application with the help of UIWebView and want to access the same varaible on safari.
Consider I set the localstorage variable for URL: http://localhost:3000/index.html from native application and want to access the same on safari.
This is deliberately not possible because of native app sandboxing. One app cannot access another's data including UIWebView's cookies, localstorage etc. This includes no sharing of information between Safari and third-party apps.
The closest you are likely to come is to have your app launch a URL that will open in Safari and fetch a script from your server that sets the value you require.
Apart from the obvious disadvantage that this would switch out of your app and into Safari when you set the value, you'd also have to be very careful not to open all sorts of security holes, depending on what the localstorage data is used for. You'd at least need to do extensive sanity-checking of the data being stored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With