I’m new here and have been playing with Ionic and Cordova. Very interesting so far!
Anyway, I was wondering if anyone could answer the following for me please? Regarding iOS.
If an app has data inputted by the user (e.g. todos). How is persistence handled? Another important point is - what happens when a user upgrades their app, does the data get saved indefinitely/safely?
Has anyone provided iCloud features or am I jumping the gun a bit?
Now you’re getting into a pretty complex area. The best user experience will come from a local database such as the Web SQL Database (sqllite) through Cordova, but that would limit your data to one mobile device.
You would then want to synchronize your local data with data on a server when your mobile device is online. Example backends were recently discussed in this topic: What backend solution would you recommend?.
Now, With multiple users, or even just multiple devices, your distributed databases will need to reconcile conflicts. For example if you update the same record on your iPhone and your iPad while offline, how should the conflict be handled? How will you handle ID creation within different databases and maybe even with different schemes?
And then, of course, you have to consider how to present this all to the user with asynchronous communication. I have looked but never found a framework that offers all of this. Perhaps the client manager that @Calendee mentioned? Let us know if you find one.
Thanks @Calendee, I was wondering - is there a list of all the plugins that Cordova has that Ionic supports? That would be useful!
I’m going to have a play tonight and see what I can get working. I imagine a quick check to see if the device is online or not and save to either local storage or cloud. The tricky bit, as you mention @jeff_collier, is the issue of ensuring data isn’t put out of sync…
I’ve been using $window.localStorage[key] in my ionic app on iOS. I’ve been facing an issue where the OS will clear localstorage based on how much memory is available on the device (as described here: https://www.scirra.com/forum/wkwebview-webstorage-can-be-cleaned-by-ios8_t120439). I’m only storing small strings and thought this was bizarre. Has any faced similar issues?