We are using CNSaveRequest in CNContactStore to add contacts to system device contacts. But when calling execute method the app crashing in internal libraries.The code was working fine until macOS Monetery, In macOS Ventura beta we are facing this issue.
Sample Code:
let store = CNContactStore()
store.requestAccess(for: .contacts, completionHandler: { isSuccess,error in
guard isSuccess else {
return
}
let contact = CNMutableContact()
contact.familyName = "Hello"
contact.givenName = "Contact"
let request = CNSaveRequest()
request.add(contact, toContainerWithIdentifier: nil)
do {
try store.execute(request)
}
catch {
print(error)
}
})
Crash: