Questions tagged [cncontact]

CNContact is a thread-safe class for Apple architectures (MacOS, iOS, watchOS, etc.) that represent an immutable value object for contact properties, such as the first name and phone numbers of a contact.

The contact class (CNContact) is a thread-safe, immutable value object of contact properties, such as the contact’s name, image, or phone numbers. The contact class is like NSDictionary; it has a mutable subclass CNMutableContact you can use to modify contact properties. For contact properties that can have multiple values, such as phone numbers or email addresses, an array of CNLabeledValue objects is used. The labeled value class is a thread-safe, immutable tuple of labels and values. Labels describe each value to the user, allowing differentiation such as home and work phone numbers. The Contacts framework provides some predefined labels and you can create your own custom labels.

256 questions
2
votes
1 answer

Is it posible to retrieve my own contact details from phone book?

I am using the CNContact framework to get all of the contacts from my phone and I need to compare some data with my own contact details. Is it posible to get my own contact details ? I can find myself listed when retrieving the contacts using apple…
Adrian
  • 19,440
  • 34
  • 112
  • 219
2
votes
0 answers

How did Swarm app get my phone number?

I gave Swarm access to my contacts to know who else were on Swarm. To match me with the people in my address book, I was expecting Swarm to ask me for my phone number and start and SMS validation process. It didn't. And it could match me with my…
Cherif
  • 5,223
  • 8
  • 33
  • 54
1
vote
0 answers

iOS - Can not sort contacts same to Contacts framework order

Im handling a screen which show contacts from contactDictionary with same native device order. I have seen this method in Contacts framework. /*! The contact comparator for a given sort order. */ +…
Pxxx
  • 11
  • 1
1
vote
0 answers

How do I nest CNGroups, and how do I detect nested CNroups?

I can't seem to find any API support for adding a CNGroup to another CNGroup, although this iOS13 CNChangeHistoryAddSubgroupToGroupEvent class strongly implies it can be done. I have found UX in the macOS contacts app to do this, but iOS and iPadOS…
Stripes
  • 4,161
  • 2
  • 25
  • 29
1
vote
2 answers

CNContact birthday displayed with a timezone gap

I'm trying to get the birthday of person that i fetch in the Contacts app using the ContactsCN Framework. The person's birthday in the Contacts apps is June 22, 1980. In my app, the actual result is June 21, 1980. The desired result is June 22,…
Pat N.
  • 35
  • 5
1
vote
1 answer

How do apps like Skype show caller IDs in the native iOS recent calls list when a user isn't a contact in Swift?

I've noticed that many apps like Skype, Slack, Telegram etc, are able to show the ID of contacts saved within those apps in my native iOS recent calls list as if they are existing contacts. Here's a great example I found in a Google search: I…
LondonGuy
  • 10,778
  • 11
  • 79
  • 151
1
vote
2 answers

iOS14 CNContactViewController not showing delete button issue

When I press Edit from contact card, my CNContactViewController is not showing the delete option in the bottom of the screen. NB: the button remains shown for iOS 13.
1
vote
1 answer

CNContact: Contact Identifier properly changes after saving a contact to device

I am facing a strange problem only in one iPhone 11 pro. When I tried to save a new contact, first I save that contact and get the contactId and then I save to my DB. First log: 2020/10/15 20:22:42:181 EVENT: OTHER Add/Updated Contact with deviceId…
Ankur Prakash
  • 1,417
  • 4
  • 18
  • 31
1
vote
1 answer

While sharing a vcf file in iOS , the file is not getting attached in mail using swift

I'm trying to share a vcf file using UIActivityViewController. It shares the file with all other options except mail. It just opens the mail composer without any attachment. Here's my code: guard let directoryURL = FileManager.default.urls(for:…
Suhail
  • 324
  • 1
  • 15
1
vote
0 answers

Proper way to search for contacts Swift 5

I'm making an Apple Messages app clone and am currently mimicking "New Message" design. I have a UITableView (to display the results) with a UISearchController (to search for contacts). I'm trying to find the best way to search through a user's…
fphelp
  • 1,544
  • 1
  • 15
  • 34
1
vote
1 answer

Add Notes and Images to serialized VCF contact

I am trying to save a contact as a vcf using CNContactVCardSerialization which has worked out relatively well. I did find that apple doesn't include Notes or Images as part of the VCF. I did use a stackoverflow answer to help the images serialized…
Prasanth
  • 646
  • 6
  • 21
1
vote
1 answer

CNContactPickerViewController - Cannot make any selection

I am using CNContactPickerViewControllerto allow the user to see their contact list and select a contact. However, although I can show them their contact list, there is no ability to select any contacts. I am only looking for them to select a single…
C6Silver
  • 3,127
  • 2
  • 21
  • 49
1
vote
1 answer

CNContactPickerViewController Retrieve ONLY Selected Item

When the delegate method is implemented: func contactPicker(_ picker: CNContactPickerViewController, didSelect contactProperty: CNContactProperty) The user is able to select a contact from the list, then the contact details automatically appear.…
Jake Chasan
  • 6,290
  • 9
  • 44
  • 90
1
vote
1 answer

How to show picture inside CNContactViewController(forUnknownContact:)

How would I get an image inside CNContactViewController(forUnknownContact:) I tried something like this: fileprivate func showUnknownContactViewController() { let aContact = CNMutableContact() let newEmail = CNLabeledValue(label:…
Test tester
  • 113
  • 10
1
vote
0 answers

Can i get my info contact from all CNContact iOS?

I am working on a contact app. Currently, I use CNContact framework to access all contacts. How may I identify if a particular contact has set in my info?
Yogendra Jadeja
  • 121
  • 1
  • 5