Important: iOS6 and Data Storage

iOS 6 was released today. It has some important differences in how data is stored. For some users, it will appear that all data is lost. Read this to understand why and learn a workaround.

The information in this blog post, while intended for App Studio users, applies to all web apps, regardless of what tool was used to produce them.

  1. Home Screen data is saved in a separate place from Web App data.

    Prior to iOS 6, SQLite data and localStorage for Web Apps and Home Screen apps shared the same data. In iOS 6, they are separate. If you save some data in the web app, it will not appear in the Home Screen version of the app.

  2. Save to Home Screen does not preserve the user’s data.

    If you do a Save to Home screen from a web app, the data you have entered into the Web App to date will not be copied to the Home Screen app: it will start with empty files. Any data the user has already entered is only available if he continues to run as a Web App.

  3. Data in Home Screen apps is lost when upgrading to iOS 6.

    This is probably the worst news. If you had a Home Screen app in iOS 5 and entered a lot of data into it, you will lose it when upgrading to iOS 6. You can get at it only if you run your app as a Web App.

    If you have end users using apps created with App Studio, you will want to warn them of this.

  4. Data in Home Screen apps are now stored like native apps.

    Native apps each have their own sandbox where their data is stored, backed up and restored to. Prior to iOS 6, Home Screen apps shared data with the same app running in the browser. If the user cleared the cache in the browser, the Home Screen version of the app would lose its data too.

    With iOS 6, Home Screen apps’ data gets saved to a sandbox just like native apps. Backups and restores handle the data properly, and clear cache in the browser will not affect them.

  5. The intermittent data loss of iOS 5.1.1 seems to be cured.

The conclusion? iOS 6 offers much improved saving of data. Home Screen apps are now equal to native apps in this regard. However, there will be confusion over data entered in the browser when an app is turned into a Home Screen app. There will also be difficulties for apps on devices upgraded to iOS 6.

The best solution to this would be for Apple to fix Save to Home Screen to have it copy the localData and SQLite databases from the Web App.

What about Android?

Android (at least to 4.1) works similarly to iOS 5. The data in Web Apps is shared with the browser and is vulnerable to being deleted by a clear cache.

Thanks to Al Richey for helping with the tests to establish this!