I not too long ago needed to change my apps to a different App Retailer developer account. I knew that app was about to lose entry to outdated keychain information upon the subsequent replace as a result of a brand new APP ID prefix. Its principal information was saved in Software Help Library listing and I anticipated it to stay by transition. However my customers nonetheless misplaced their information 🙁 Does anybody know why? I’ve not met any point out of it wherever.
My code merely hundreds/saves bytes within the file with an url like this file:///var/cell/Containers/Knowledge/Software/012345678-0123-0123-0123-0123456789AB/Library/Applicationpercent20Support/com.firm.App/file.sav
:
class fileprivate func saveURL()->URL
{
let supervisor=FileManager.default
let directoryURL=supervisor.urls(for: .applicationSupportDirectory,in: .userDomainMask).first! as URL
let appName=Bundle.principal.bundleIdentifier!
let appDir=directoryURL.appendingPathComponent(appName,isDirectory: true)
do
{
attempt supervisor.createDirectory(at: appDir,withIntermediateDirectories: true,attributes: nil)
print("Dir (appDir) created")
}
catch
{
print("Can not create dir (appDir)")
}
let fileDestinationUrl=appDir.appendingPathComponent("file.sav")
return fileDestinationUrl
}
I can not absolutely check that scenario since XCode wouldn’t set up a brand new model over the one from the shop. What I checked was constructing an outdated model utilizing a brand new staff, then putting in a brand new model over that one. It labored superb with no information loss.
Did anybody meet an identical scenario? What ought to I exploit to verify my different apps don’t lose customers’ information throughout switch?