I'm trying to get my WebApp
to work on my iPad (iOS 7). According to all the research I've done, it seems like you need to enable cookies specifically (goodness knows why!)
I found this post on SO:
How to enable cookies for Android phonegap 1.8.0 app?
Thats all good and well, apart from the fact I'm using PhoneGap Build
to create my app (thus don't have access to those files to edit)
Can anyone suggest what I can do? It seems insane that I can't use localStorage
(or cookies) on my iOS app without doing this hack! (my app works perfectly on Android, which doesn't have this issue).
I've looked at installing XCode and manually coding/compiling the app, but this will only work on a Mac (which I don't have)
UPDATE: Having a look around, it seems that the only solution (I can find), is to write a plugin to enable the cookies. Thats all good and well- but:
Would anyone be interested in writing a plugin for me? As far as I can see it would just need to invoke:
CookieSyncManager.createInstance(this);
CookieSyncManager.getInstance().startSync();
webView = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
This is driving me up the wall!
Just going over my questions, and thought I'd answer this one - It seems that for some reason, iOS doesn't like loading the localStorage() on the page ready. To get around this, you have to also set a 1.5 second timer - so it doesn't run before iOS has loaded localStorage(). i.e:
setTimeout(function() { doInit() } , 1500);
This isn't ideal - and it would be much better if there were a way to enable cookies for iOS in PhoneGap Build
, without having to be able to write a plugin to do it (which I don't have the skills to do ;))
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