phonegap / build

This is the public repository for PhoneGap Build source and bug tracking
92 stars 33 forks source link

[Build] BackupWebStorage No Longer Works #338

Closed amirudin closed 8 years ago

amirudin commented 9 years ago

The following preference is no longer working: <preference name="BackupWebStorage" value="none"/ >

Original implementation: https://github.com/phonegap/build/issues/191

wildabeast commented 9 years ago

Hi @amirudin, can you share reproduction steps for this failure?

amirudin commented 9 years ago

Thanks @wildabeast but it will take times to reproduce as it require submitting to Appstore (only Apple can tell). However here is the original discussion leading to this report: https://getsatisfaction.com/nitobi/topics/backupwebstorage_and_ios

dmzone commented 9 years ago

@wildabeast You can check if the preference works following these steps:

patrickbense commented 9 years ago

Is there any movement on this? We are experiencing the same issue and need to re-submit to Apple ASAP. We set the preference to local and are going to rebuild but we have no guarentee that this will be successful.

Is there anyone from Phonegap who can help us with this issue?

letudiantMP commented 9 years ago

Hi We have exactly the same issue. Is there any way to solve this problem without use

<preference name="BackupWebStorage" value="none"/ > ? 
mparpaillon commented 9 years ago

@wildabeast

To reproduce this bug,

cordova create hello com.hello.www hello
cordova platform add ios

Add this to the config.xml file (or local, both are broken)

<preference name="BackupWebStorage" value="none" />

Add some content to your LocalStorage in index.js. Something like

for(var i = 0; i < 5000; i++) {
    localStorage.setItem('wild_' + i, 'Please fix thiiiiiiiiiiiiiis. Thx');
}

Build it (Meh)

cordova build ios

Open the project in Xcode Build it on a real Device (!= emulator) When the app has launched Go to Settings / iCloud / Storage / Manage storage / Tap on your Device (eg. iPad of wildabeast) Tap on "Show all apps"

Now wait a few seconds (like 10 or 20... It takes some time to refresh)

And boom the app appears (bottom of the list) ! The local storage is stored in iCloud. The app will be surely rejected (Sometimes "Apple validators" don't see it or tolerate it... I'm not sure)

Hope you can help us with this. I've tried a lot of work around (with File API, nothing worked) and I've tested many versions of Cordova (all from 3.6.0-0.2.9)

mladenp commented 9 years ago

So whats up with this? This is important feature that still doesn't work. A lot of apps get rejected because of large documents folder.

tiagoad commented 9 years ago

Just had two apps rejected because of this issue. Is there any fix?

mparpaillon commented 9 years ago

You have two possibilities. Remove Telerik's WKWebView plugin (https://github.com/Telerik-Verified-Plugins/WKWebView/issues/76) or use less LocalStorage.

For now I am not aware of any other option.

tiagoad commented 9 years ago

I am not using that plugin. However, it seemed the problem was with storage in the Documents directory. I am now using cordova.file.dataDirectory to store my data.

Thanks :)

wildabeast commented 9 years ago

Created an issue on the Apache Cordova Jira.

stayted commented 9 years ago

9 month for a bug (like this)??? It's crazy!

shazron commented 8 years ago

There is a misconception on what this setting is.

This is solely for backing up your localStorage/websql storage of the WebView to workaround the changes by Apple in iOS 5.1 and greater, where they are not automatically backed up.

"cloud" means that they are backed up by iCloud. "local" means that it is not backed up by iCloud but backed up in Documents/Backups, with the "Backups" folder flagged to not be backed up by iCloud. "none" will not backup anything to anywhere.

The reason "local" saves in "Documents/Backups" is so that it will be backed up by iTunes, so that your app will have the localStorage/webSQL data available when you restore a backup.

If you store anything in Library or Documents (except Library/Caches), it will be backed up by iCloud. For the Cordova File Plugin, to use the Library/Documents folder but not sync it to iCloud, you use the specific extra filesystem: https://github.com/apache/cordova-plugin-file/blob/master/README.md#ios

On a fresh new project, and examining the iCloud data for your app in Settings, you might see that it is enabled and that 0.7kb is being stored. This is your app's preferences file in Library/Preferences, since that does get backed up.

https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html

wildabeast commented 8 years ago

Closing as expected behaviour, see Shazron's clarifications.