iOS Development

ios – Shedding an information saved within the Utility Help Library after app switch to a different developer account

I lately needed to swap my apps to a different App Retailer developer account. I knew that app was about to lose entry to previous keychain information upon the subsequent replace resulting from a brand new APP ID prefix. Its important information was saved in Utility Help Library listing and I anticipated it to dwell via 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/Utility/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.important.bundleIdentifier!
    let appDir=directoryURL.appendingPathComponent(appName,isDirectory: true)
      attempt supervisor.createDirectory(at: appDir,withIntermediateDirectories: true,attributes: nil)
      print("Dir (appDir) created")
      print("Can not create dir (appDir)")
    let fileDestinationUrl=appDir.appendingPathComponent("file.sav")
    return fileDestinationUrl

I can’t totally check that state of affairs since XCode wouldn’t set up a brand new model over the one from the shop. What I checked was constructing an previous model utilizing a brand new group, then putting in a brand new model over that one. It labored wonderful with out a information loss.

Did anybody meet the same state of affairs? What ought to I take advantage of to ensure my different apps don’t lose customers’ information throughout switch?


Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button