[solved] iOS file storage persistency - direct xcode update

I have an app that is off-appstore, developed just for couple of company devices , being regularly updated directly via xcode. App is using sqlite storage and also have a functionality to take images with the camera and store them internaly in dataDirectory using cordova.file plugin.

The problem is, that when update is performed via xcode, the files from dataDirectory gets deleted, however the data in sqlite storage are persistant. Is this a standard behaviour, or are there any options to keep the image files persistent when update is performed? I also tried syncedDataDirectory, but with same result. Any help would be appreciated!

Turned out to be a problem between my chair and keyboard - in case anybody runs into the same issue, do not save the full filepath of your documents/images in the database/storage, as the app container id keeps changing everytime the app is updated via xcode - this was my issue.

Problem solved by saving only filename, and generating the full path on demand:

this.imageSrc= this.file.dataDirectory + fileNameFromDB
1 Like