Reputation: 517
I have an iPhone app that I built using PhoneGap. I'm now looking to convert this to a native app. As part of the functionality people have been able to store notes using the normal HTML 5 Web SQL database. If at all possible I'd like to prevent existing users from losing their notes so I was wondering if I could access the previous database from the new, native iPhone app.
If not, does anyone have any suggestions on how to successfully migrate the data over. Thanks a lot for your time, I appreciate it.
Upvotes: 1
Views: 405
Reputation: 70733
Use Xcode's 4.x Organizer window to view your app on a device and see where in the app's sandbox file structure that the UIWebview is storing it's data.
Another possibility is to have a hidden UIWebview function check for an existing HTML5 database, and, if data is present, passing that data back up to the app as part of some stringByEvaluatingJavaScriptFromString: calls to the web view. Or pass an empty string back for no existing data.
Upvotes: 1
Reputation: 13640
I don't believe you can access the WebSQL db from native code. However, you might have them sync their current notes to your server, then you can push it back down to them when you get the native code written.
Upvotes: 0