Enable Permissions (iCloud)

Greetings!

In my application I request permission from the user to utilize iCloud.

func requestPermission() { CKContainer.default().requestApplicationPermission([.userDiscoverability]) { [weak self] returnedStatus, _ in DispatchQueue.main.async { if returnedStatus == .granted { self?.permissionStatus = true } } } }

How can I programatically ask for this permission again via a button? Sometimes a user may deny or disable this permission in error.

Thank you! :)

the system will ask the user for permission only once on your behalf. after that, you can check the status of the account, and if its disabled, display a UI directing the user to Settings to change the permission.

@deeje

Thank you! Resolved :)

Enable Permissions (iCloud)
 
 
Q