iOS Remove sqlite after uninstall app - ios

I have an App developed in XCode, the DataBase was made in Sqlite, but when I remove the app from my iOS device, I lost all the information from that DB.
When I install the App again, I have the DB but without information inside.
Can I keep that file.sqlite (in a cloud)? And when app is reinstalled (download) to use the same file.sqlite and to have the data that I had before in that file.

No you cannot keep the file.sqlite on the filesystem after your app is uninstalled. As soon as the app is uninstalled the associated data file is also deleted.

You should be able to solve this by synchronizing the SQLIte database with another database stored in the cloud. If you associated the synchronized records with a user account, the next time they use that user account, you can refresh the local database with the server database. It won't matter if they deleted the app or moved to a new phone. You're storing their backup on a server.

Related

Is it possible to retrieve deleted iOS simulator app data?

I've been working on an iOS app and making lots of progress on tweaking a sqlite DB. Using FMDB to interact with the DB, the copy I was working from was the one copied into the simulator app's bundle, not the version that sits in Xcode. I accidentally deleted the app from the simulator, and with it several days of progress on this DB I've been working on. Is there anyway to get that data back? Where do deleted simulator apps go to die?
It won't be possible to get anything of deleted application until and unless you are storing it to permanent storage i.e Keychain.
So, It's not possible to get the DB file for your previous installed application.

How to update app in iOS app store if programming language changes?

I have an application written using native iOS with offline db feature. Now we are planning to rewrite the application using React native and submit it again to app store with same bundle id, and by updating version number.
Problem is i have offline db in old app. And that may contain data created by user. If i develop the same application using react native and push it as an update to app store, will the offline db get affected?
Will all the data stored persist or it will be installed as a new fresh application with no saved offline data?
What will be the impact for my existing app in app store and what is the app store submission process for this kind of requirement?
Problem is i have offline db in old app. And that may contain data
created by user. If i develop the same application using react native
and push it as an update to app store, will the offline db get
affected?
It depends what are you doing with the new application. In general it will remain untouched.
Will all the data stored persists or it will be installed as a new
fresh application with no saved offline data?
All the data will persists.
What will be the impact for my existing app in app store and what is
the app store submission process for this kind of requirement?
The submission process is the same as an update to this version. What do you mean by "impact"? The users will see it as an update. If you need to keep a login or maintain the previous data it's the job of the new app to migrate the data or to read them in the database.
To try an update you can install the old app from Xcode and then install the new one without deleting it. Make sure to use the same provisioning profile.

How to test local storage persistence after iOS App Store update?

At one point there was an AIR bug (3.5) that changed the location of the LSO storage, causing local SharedObjects to be "lost" after an app update. Apparently this issue was resolved in 3.6 and life goes on.
At this point I don't have 100% confidence that any user data stored in a SharedObject on an iOS device will persist after an AppStore update, and I would like to be able to test this out prior to actually submitting the update to Apple.
However, my experience has been than whenever you test/debug your app and a new IPA is generated, the old app is completely wiped, including all of its data. So there's no way that I know of that I can test an update of the app against an older version to ensure that the SharedOjbects remain accessible and working fine.
Are there any solutions? Or can anyone who's using LSO for persistent App data storage confirm that they've pushed an update through the App Store and retained saved user data?

Where do I properly place sqlite database so it wouldn't get removed on app update from appstore?

I am frightened to release my app using this technique to put the database on NSDocumentDirectory. what if I put on an update? will it get removed? users of the app might get really annoyed when the database will get overwritten and clear its contents?
do you think im doing it right?
https://developer.apple.com/library/ios/DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/PerformanceTuning/PerformanceTuning.html
Files Saved During App Updates
When a user downloads an app update, iTunes installs the update in a
new app directory. It then moves the user’s data files from the old
installation over to the new app directory before deleting the old
installation. Files in the following directories are guaranteed to be
preserved during the update process:
<Application_Home>/Documents
<Application_Home>/Library
Although files in other user directories may also be moved over, you
should not rely on them being present after an update.

Is it possible to retain data of the older version if a new version of app is deployed on device?

I am new to iOS development so my question may be n00bish.I am working on an app for iPad which downloads PDFs and stores on the device(iPad) in the Documents directory so the user can still read them if he isn't connected to WiFi. My question is:if a newer version of the app is available and the user installs it, will it delete all the data(documents,in this case) from the device? If yes,how do I prevent the old data from being deleted? I am using CoreData in this app(if this helps)
When a user installs an updated version of any app, the app's sandbox is kept intact. Only the app and its resource bundle are replaced. So basically, anything you have stored in Documents or Library will be kept intact after the update process. There is no guarantee that files in Library/Caches or tmp will be kept but those should only have transient files anyway.

Resources