Hi Team, we love the XDK but recently started using phonegap build as we need to use plugins not supported by XDK...great job guys over the past few years, it was a huge help to us.
Our app uses a sqLite database, which has been there for 3 years and never had an issue with any app updates. With the same code and plugins, XDK and Phonegap builds give different results in IOS 10 (iOS 9 is fine) - The XDK version works just fine, the app picks up the database with all it existing data after the upgrade. When building the same app, with the same code, same plugins and versions, same CLI version, Phonegap causes the database to be re-created - but it gets weirder! The "old" database is actually kept somewhere, and if I re-install the XDK version of the app, it re-appears...
I have spent about 20 hours on it so thought I would share the issue in case someone can point me in the right direction...I thought it might have something to do with WKWebView but don't think so as XDK uses it too on iOS 10 (checked indexedDb support) - I am lost and cannot release the new version as we can't have users losing data...
I'm guessing this is related to the cordova-plugin-file and the many different places files can be stored > https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/#where-to-store-files < Also, I would check to see if it could have something to do with Xcode 7 versus Xcode 8. The XDK cloud-based build system builds with Xcode 7, I suspect the PhoneGap Build system is using Xcode 8 (but I do not know with certainty). That could also have something to do with it.
Might have to do with this > https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/#ios-quirks <
Thanks for your reply.
1) I wasn't using the cordova-plugin-file, just standard webSQL/sqLite so that was not the issue.
2) For a while I thought you were on to something with the Xcode versions, but after 12 hours I managed to build a version of the app using Xcode 7 from my mac (ios sdk 9.1 - same as what you are using) - That didn't make any difference, same thing happened on iOS 10.
Finally after 4 days of trying to solve the root cause I had to admit defeat. Something is different between XDK builds and other builds, and in iOS 10 this causes the sqLite Db to be re-created in a different place on first app launch after update (to non-SDK build). As I said if I re-install the previous XDK build, the old sqLite database is there - so it's not actually deleted by the non-XDK build, just ignored or not accessible...
I have resorted to releasing an "in-between" version built with XDK which will backup the old sqLite database to file so that it can be restored when we release our first Phonegap build....
It's all fun & games!
Thanks anyway, if you think of anything else let me know.
Thanks for the update regarding the issue. Given your description, the only other thing I can think of is what you already mentioned in your original post: WkWebView versus the old webview.