3

I try to add CloudKit support to my iOS app. My goal is to save data to user's privateCloudDatabase and be able to restore it if user change phone/reinstall app. Everything works great, but user can't delete app data from iCloud(from code I can delete it successfully)

Precondition: user device have iCloud enabled

Steps to reproduce(ios 13, but reproduces on any ios):

  1. From code save a CKRecord to user's privateCloudDatabase
  2. On user's device go to settings > Apple ID(on top) > iCloud > Manage Storage > my application > Delete Data > Delete

Expected result: applications list updated and my app not in the list

Actual result: my app is still in the list

Here's how I add record to iCloud:

let record = CKRecord(recordType: "backup", recordID: CKRecord.ID(recordName: "userName"))
let operation = CKModifyRecordsOperation(recordsToSave: [record], recordIDsToDelete: nil)
operation.savePolicy = .allKeys
operation.modifyRecordsCompletionBlock = { savedRecords, deletedRecords, error in
       print(error)        
}
CKContainer.default().privateCloudDatabase.add(operation)

I expect that user can go to Settings and manually remove app data from iCloud. Otherwise if user delete my app he won't be able to delete this data from iCloud forever(yes, I tried to delete app and then delete data - result is the same)

Video: https://www.youtube.com/watch?v=UGk0hpi8gtA

Question: Is it a bug or I missing something? Any workaround to fix this?

Update: I found in app store application, which probably uses CloudKit, and if I install it - it can't be deleted from my iCloud storage forever. https://apps.apple.com/us/app/ulysses/id1225571038

1
  • Have you resolved the issue? Commented Oct 7, 2024 at 14:48

1 Answer 1

0

I just tried this as well and the app doesn't disappear from the list immediately, but if you reload the list of apps, it works. Try these steps:

  1. Delete the app from the list.
  2. Wait a minute or so.
  3. Go out to the iCloud settings then go back into Manage Storage and the app should be gone.

If it still doesn't work after manually reloading the list, I suggest filing a bug with Apple: feedbackassistant.apple.com

Sign up to request clarification or add additional context in comments.

1 Comment

Did you add record using code from my example? I asking because if I add data to iCloud using "iCloud documents"(ubiquityContainer) it works ok and user can delete data instantly. I tried to wait for a minute(and even waited 2 days), tried to reboot device, tried to delete data from iCloud using other device(the one where my app was never installed) - nothing helps, this app still in my iCloud list. Did you watched video I attached? This is what you mean except waiting for a minute, right? I filled a bug at feedbackassistant.apple.com before asking here, but yet no answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.