requestApplicationPermission(.userDiscoverability) won't work

I have this code that's supposed to get CloudKit to request permission from the user of my app to allow his/her user identifiable information to be known to my app, but I get an error.


    @IBAction func actionGo(_ sender: UIBarButtonItem) {
     
        CKContainer.default().requestApplicationPermission(.userDiscoverability) {
         
            (status, error) in
         
            print("error=", error)
         
        }


The error says:


error= Optional(<CKError 0x60400025b480: "Service Unavailable" (6/2022); "Request failed with http status code 503"; Retry after 30.0 seconds>)


What does that error mean and how do I figure out what the problem is? Is it merely a matter of enabling certain setting in CloudKit?

This must be a transient issue with CloudKit servers, try it again.

I've tried it on and off for about a week now.

It works ok in my app, Did you try using another container?, maybe is an issue related with your container.

Accepted Answer

I got it to work after I logged in to the Dashboard. Something happened when I logged in to Dashboard that made it start working. I don't know what.

requestApplicationPermission(.userDiscoverability) won't work
 
 
Q