cloudkitcatalyst

requestApplicationPermission userDiscoverability failed in Mac Catalyst


I have ios app using requestApplicationPermission userDiscoverability. Today, I add Mac Catalyst support, but failed: "requestApplicationPermission(.userDiscoverability) failed, error: CloudKit access was denied by user settings".

container.requestApplicationPermission(.userDiscoverability) { [weak self] (status, error) in
    guard let self = self else { return }
    DispatchQueue.main.async {
        if let error = error {
            foolPrint("requestApplicationPermission(.userDiscoverability) failed, error: \(error.localizedDescription)")
        }
    }
}

And I cannot find settings about userDiscoverability in mac settings, where is it?


Solution

  • This iCloud user guide shows how to change these settings:

    1. On iCloud.com, go to Account Settings, then click Manage Apps That Can Look You Up in the Advanced section.
    2. To prevent an app from showing your name and email address to other users, deselect the app’s checkbox in the list.

    screenshot showing how to find the look me up by email setting