0

I tried to programmatically present a CNContactViewController for a new contact, but I got error "Access to PassKit Shared Cache file denied. Please verify sandbox exceptions and/or file a Radar." The CNContactViewController also did not present.

I check that I had all valid permissions, such as Privacy--Contacts in the info.plist and that I had gotten the permissions in my code. I had.

let cnContactViewController=CNContactViewController(forNewContact: contact)
vc.present(cnContactViewController, animated: true)

I expected the app to present ContactsUI's CNContactViewController with a contact filled in it's fields, but it didn't happen, and I got two error messages: Access to PassKit Shared Cache file denied. Please verify sandbox exceptions and/or file a Radar. and CNUI ERROR Contact view delayed appearance timed out

Matt
  • 560
  • 1
  • 5
  • 12

2 Answers2

2

I am getting same error, and i fixed by using below code

let vc = CNContactViewController(forNewContact: contact)
vc.delegate = self
let navigationController: UINavigationController = UINavigationController(rootViewController: vc)
            present(navigationController, animated: false) {
                print("Present")
            }
Asad ali
  • 245
  • 1
  • 2
  • 13
0

It turns out the first error, "Access to PassKit Shared Cache file denied. Please verify sandbox exceptions and/or file a Radar", didn't have to do with the CNContactViewController not presenting. To solve the problem of it not presenting, I used @Andrew Vyazovoy's post CNUI ERROR Contact view delayed appearance timed out and put the CNContactViewController as the root view controller of a navigation controller and presented the navigation controller, and the CNContactViewController showed on the screen. The privacy problem is unrelated.

Matt
  • 560
  • 1
  • 5
  • 12
  • Since nobody else has commented on the PaskKit part, would you consider editing the question? Saves the readers time and mental processing. TIA. – benc Mar 16 '20 at 12:35
  • I thought it might help people because others could have the PassKit error at the same time as the CNContactViewController not presenting. – Matt Mar 16 '20 at 13:22