The following question:
https://developer.apple.com/forums/thread/115819
is answered by saying that an app update will cause user data in the library directories to be erased. I tried updating a build in TestFlight and it seems this is not the case. However, a tester updated and had elements of the old build remaining. Having to delete the app and reinstall to solve this problem, his game data was erased, as expected.
I am currently saving the player's game data (a codable object of about 30K) in the caches directory and am concerned that once the app is on the App Store, that any app updates (for bug fixes or whatever) will erase the player's progress. I don't mind that deleting the app will delete all the data, but I want the data to persist across updates.
Could someone please clarify whether or not an app update deletes the caches directory and starts anew and if it does, what's the recommended way to make user data persist across app updates?
https://developer.apple.com/forums/thread/115819
is answered by saying that an app update will cause user data in the library directories to be erased. I tried updating a build in TestFlight and it seems this is not the case. However, a tester updated and had elements of the old build remaining. Having to delete the app and reinstall to solve this problem, his game data was erased, as expected.
I am currently saving the player's game data (a codable object of about 30K) in the caches directory and am concerned that once the app is on the App Store, that any app updates (for bug fixes or whatever) will erase the player's progress. I don't mind that deleting the app will delete all the data, but I want the data to persist across updates.
Could someone please clarify whether or not an app update deletes the caches directory and starts anew and if it does, what's the recommended way to make user data persist across app updates?
The Documents directory is not necessarily exposed to the user but, if it is then, yeah, it’s not appropriate for this.
If the Documents directory doesn’t work for you, see QA1699 Storing Private Data.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
If the Documents directory doesn’t work for you, see QA1699 Storing Private Data.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"