Contacts

RSS for tag

Access the user's contacts and format and localize contact information using Contacts.

Posts under Contacts tag

195 Posts

Post

Replies

Boosts

Views

Activity

CKError 429 from CloudKit, using CKDiscoverAllUserIdentitiesOperation
I am working with the CKDiscoverAllUserIdentitiesOperation. I would like to fetch all users, however, CloudKit returns the following error: <CKError 0x6000009ce040: "Request Rate Limited" (7/2058); "Operation throttled by previous server http 429 reply. Retry after 6432.8 seconds. (Other operations may be allowed.)"; Retry after 6432.8 seconds> Here's my code: var identities = [CKUserIdentity]() let operation = CKDiscoverAllUserIdentitiesOperation() operation.userIdentityDiscoveredBlock = { userIdentity in identities.append(userIdentity) } operation.discoverAllUserIdentitiesCompletionBlock = { error in if let error = error { fatalError(error.localizedDescription) } else { completion(identities) } } operation.qualityOfService = .userInitiated CKContainer.default().add(operation) App adds that operation in the viewDidAppear method . Also I have requested to the application permission for user discoverability (accodring to the Apple's documentation: https://developer.apple.com/documentation/cloudkit/ckdiscoveralluseridentitiesoperato)
1
0
1.3k
Dec ’22
What size image to programmatically add to a contact such that it'll appear on the call screen nicely?
I want to programmatically create a contact with an image with the result that when the iPhone receives a call from the number associated with that contact its image will appear on the incoming call screen (occupying the full screen, not the little tiny icon variation). But I'm having a hell of a job trying to figure out what dimensions should be used for the image to add to the contact. If on the iPhone I take a screenshot and add that manually to a contact then make a call, then the call screen more or less displays the entire screenshot almost the same as the actual desktop. The call screen appears to be slightly magnifying the image. So whatever size the screenshot is should be close enough for the contact image. I've got an iPhone 14 pro and its UIScreen.main.bounds is 932 by 430. If I export an iPhone screenshot to a Mac, I can see its image size is 2796 by 1290, which is exactly 3 times the bounds size. So I created an image of size 2796 by 1290 and programmatically added it to a contact (using CNMutableContact.imageData = myUIImage.pngData(). But when a call arrives the image that gets displayed on the call screen is way way way out of whack and alignment. Same too if I add am image of size 932 by 430 (i.e. without the 3 times factor). I've done lots of experiments but I just can't figure out what size image I should add to the contact. Does anybody happen to know? (I exported the contact where I manually added the screenshot image as a .vcf to see what image size they use, but it doesn't export the full image that's actually displayed during a call screen, it just exports a truncation of the full image which is a square of 1200 by 1200.)
0
0
918
Dec ’22
Adding or using Note Field Access Entitlement
Hello, Ive ben having an issue with one of my Apps since Ventura came out. The app won't create a new contact It fails giving a few different warnings but no real error. I have tried it unto Ventura 13.0.1 (22A400) The error is 2022-12-03 09:33:54.543143+1000 **** [1941:15105] [api] Attempt to write notes by an unentitled app 2022-12-03 09:33:54.580714+1000 **** [1941:15105] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-12-03 09:33:54.580765+1000  **** [1941:15105] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-12-03 09:33:54.581969+1000 **** [1941:15105] [ABCDContact] An ABCDRecord is being saved without having a container assignment. Assigning the contact to <CNCDContainer 0x6000013c92c0 ab>. Please remember to assign contacts to containers to avoid recurring container lookup and contact re-validation costs. . When I follow the instructions on this page https://developer.apple.com/documentation/contacts to create a new contact It fails on Ventura to create a new contact and I don't know why. So I submitted a feedback Assistant request (FB11721907) But I also went ahead and got Notes field access as that was one of the warnings. That got approved, Now I would like help adding it in my project. I logged into the Developer Portal and in Identifiers, located my app and went to Additional Capabilities ticked the Box marked Contacts Notes Field Access. Then instructions in the email say 'Once you’ve finished generating the profile, you can use it in Xcode like any other manually-generated profile.' Im not sure what this means. I tried to add 'com.apple.developer.contacts.notes' Boolean, YES, to the entitlement file as described in https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_contacts_notes but the app doesn't launch when it's added. And if I put it into the info.plist file it does nothing. Also im not sure how to add the purpose string.
1
0
2.2k
Dec ’22
Has anyone figured out how to create a CNContainer in an iOS device?
Apple Documentation says that there is only one CNContainer in an iOS device of type local. Creating a container of type exchange requires using Exchange, and creating a container of type cardDAV requires a server also. Is there any way to create a container of type unassigned? I would need to do this programmatically in Swift to use in my iOS app. This question and the posts it mentions give no answer.
2
0
2k
Dec ’22
CNContactPickerViewController long Press on the contact name behaviour is different from iOS 15 and iOS 16
in iOS 15 in CNContactPickerViewController after long press on the contact and then selecting the contact it's navigating to the the specific contact details Please check the reference video: https://www.dropbox.com/s/6z5l4kz37rapbus/iOS_15_Behavior.MP4?dl=0 in iOS 16 in CNContactPickerViewController after long press on the contact and then selecting the contact it simply closing the picker Please check the reference video: https://www.dropbox.com/s/qu861la3dikxugq/iOS_16_Behavior.MP4?dl=0 Why this change ? Is it possible same behaviour in iOS 16 also ? is there any supporting documentation about this ?
0
0
862
Nov ’22
[iOS] Search LDAP contacts
I had a need to display and search for contacts from my LDAP server. Seems the most efficient solution is to connect my Device (Application Contact) with my LDAP server. And with the Contacts framework I will be able to fetch all Local contacts including my LDAP contacts. Is there a solution to know from the CNContact if this contact is among my LDAP Contacts or other (Local, iCloud,..) If you have another solution how to search on my LDAP contacts do not hesitate to suggest me. OpenDirectory is not available on iOS Thanks
0
0
1.3k
Nov ’22
adding address to contacts on macOS
Apple itself offers a nice piece of code for adding own addresses to "Contacts"-App. (see documentation for "Contacts" - Listing 1 Creating a contact) I try to use this code. But when executing this, my app crashes with error on saving the data. (see image) My code so far: import AppKit import Contacts class ContactsClass { func addToContacts( lastName: String, firstName: String, birthDate: Date?, mail: String = "", phone1: String = "", phone2: String = "", mobile: String = "", street: String, city: String, postCode: String ) { // Create a mutable object to add to the contact let contact = CNMutableContact() contact.givenName = firstName contact.familyName = lastName if mail != "" { let homeEmail = CNLabeledValue(label: CNLabelHome, value: mail as NSString) contact.emailAddresses = [homeEmail] } contact.phoneNumbers = [] if phone1 != "" { contact.phoneNumbers.append(CNLabeledValue(label: CNLabelPhoneNumberMain, value: CNPhoneNumber(stringValue: phone1))) } if phone2 != "" { contact.phoneNumbers.append(CNLabeledValue(label: CNLabelPhoneNumberMain, value: CNPhoneNumber(stringValue: phone2))) } if mobile != "" { contact.phoneNumbers.append(CNLabeledValue(label: CNLabelPhoneNumberMobile, value: CNPhoneNumber(stringValue: mobile))) } let homeAddress = CNMutablePostalAddress() homeAddress.street = street homeAddress.city = city homeAddress.postalCode = postCode contact.postalAddresses = [CNLabeledValue(label: CNLabelHome, value: homeAddress)] if birthDate != nil { let calendar = Calendar.current let dateComponents = calendar.dateComponents([.year,.month,.day], from: birthDate!) var birthday = DateComponents() birthday.day = dateComponents.day birthday.month = dateComponents.month birthday.year = dateComponents.year // (Optional) Omit the year value for a yearless birthday contact.birthday = birthday } // Save the newly created contact let store = CNContactStore() let saveRequest = CNSaveRequest() saveRequest.add(contact, toContainerWithIdentifier: nil) do { try store.execute(saveRequest) // <<-- Error appears here!! } catch { print("Saving contact failed, error: \(error)") // Handle the error } } } Console errors are: 2022-10-28 06:26:03.473439+0200 justCare[11808:992463] [api] Attempt to write notes by a pre-Fall-2022 app 2022-10-28 06:26:03.499714+0200 justCare[11808:992463] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-10-28 06:26:03.499770+0200 justCare[11808:992463] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-10-28 06:26:03.500823+0200 justCare[11808:992463] [ABCDContact] An ABCDRecord is being saved without having a container assignment. Assigning the contact to <CNCDContainer 0x600001f9bba0 ab>. Please remember to assign contacts to containers to avoid recurring container lookup and contact re-validation costs. Access to Contatcs is granted. Sandboxing is properly set for Contacts. So why this error now? Environment: macOS Ventura XCODE 14.0.1
3
0
1k
Nov ’22
XCODE requesting access to save new contact Mac Catalyst
Im having trouble requesting access to save a new contact as of today with updating to Ventura 13.0 (22A380). Im requesting access to contacts using @IBAction func requestConactsAccess() {         CNContactStore().requestAccess(for: .contacts) { granted, error in             if granted {                 // Yes                 print("Granted")                 self.authStatusLabel.text = "Granted"             } else {                 // No                 print("Denied")                 self.authStatusLabel.text = "denied"             }         }     } But it is just being automatically denied. I can't save a contact either with an app that previously had permission. I created a small app to test this from scratch using the documentation "Working with the user’s contacts" https://developer.apple.com/documentation/contacts?language=objc I have been doing this since the first version of the app, Ive never had an issue Has something changed with regards to Requesting access to contacts in latest OS? https://developer.apple.com/documentation/contacts/requesting_authorization_to_access_contacts Thank you.
2
0
1.1k
Nov ’22
Update "preferred line" for dual-SIM devices
I am developing an application which manages contacts on iDevices. One of the attributes of a contact I would like to update is the "preferred line", a SIM to be used when calling/texting the specified contact. I've studied all available APIs to update contacts, https://developer.apple.com/documentation/contacts, but unfortunately there seems to be no way of updating the attribute I need - "preferred line". Such functionality exists on the iOS Contacts application, but seems not exposed through the SDK. Have I missed it, and such functionality exists? If no, are there plans to add such support? Thanks in advance for your kind response.
0
0
1k
Nov ’22
CNSaveRequest without having a container assignment
Hi, When creating a new contact on MacOS Im getting this new error causing my app to crash, on my app only after updating my machine to Ventura 13.0. The last error before (lldb) is "An ABCDRecord is being saved without having a container assignment. Assigning the contact to <CNCDContainer 0x6000039b51a0 ab>. Please remember to assign contacts to containers to avoid recurring container lookup and contact re-validation costs." When saving a new contact I’m using  saveRequest.add(contact, toContainerWithIdentifier: nil)             do {                 try contactsStore.execute(saveRequest) ** I guess it does not like the nil. Am I supposed to add to a particular container, like iCloud? Documentation says to set it to nil - https://developer.apple.com/documentation/contacts/cnsaverequest/1403036-add Even with the most basic example from https://developer.apple.com/documentation/contacts the save request falis.
4
1
1.8k
Oct ’22
Contacts inaccessible on iOS 16.1 for Widget Extensions
In iOS 15 and 16, once an app gave permission to access Contacts, Widgets (and Lock Screen Widgets in iOS 16) could access Contacts. 16.1 beta 1 and 2 apparently no longer allow this (and there appears to be no work around, as Widgets can't ask you for permission separately from the parent app). My app (Curmmunicate) in the App Store will fail if this doesn't get a fix as it relies on this feature. Have filed a report: FB11563817 (Contacts not accessible from Widgets in iOS 16.1 betas). Report includes an Xcode sample project showing the issue.
4
1
1.5k
Oct ’22
usernotifications.filtering entitlement prevents a contact with an image from being added/updated
My notification service extension has the com.apple.developer.usernotifications.filtering entitlement and it would appear that this is preventing a contact with an image from either being added or updated, any attempt to do so results in calls to CNContactStore.execute() throwing an CNInvalidRecords error. If the filtering entitlement is removed then there are no problems and the contact can be added/updated without problem. If the entitlement is present but the contact is added/updated without an image then it is also problem free. It is specifically adding a contact with an image that cannot be accomplished if the entitlement is present. I've encountered problems with this entitlement before - for example there are problems attempting to use a CXCallDirectoryManager from within a notification service extension with this extension. Quote from Apple on the call extension issue: "Because that entitlement can "hide" notifications, its sandbox profile is actually more restrictive than the standard NSE sandbox. That's what's preventing access to CXCallDirectoryManager, not the App ID properties.  -Kevin Elliott DTS Engineer, CoreOS/Hardware" I'd be appreciative if somebody from Apple could comment and confirm if the problems with updating contacts with an image with this entitlement is the same fundamental sandboxing issue? If so, I don't understand why a contact can be added with this entitlement, its only an issue if the contact has an image, does that imply a bug?
1
0
1.1k
Sep ’22
vcf file not giving option to save contact is it default behaviour that have been changed in ios13
I have been using your one of package https://packagist.org/packages/jeroendesloovere/vcardto generate the vcf file to save the contact in phone contact and it was working fine earlier.but now I think there are something changes in ios13 or what but now when vcf file downloads in the iPhone it's not opening the correct screen.is there anything we can do to open up the screen with the save option
1
0
1.1k
Aug ’22
How to cache Contacts in iOS?
I want to check if my code to cache contacts data while my iOS app is running is done well or not. Anyone have any samples I can look at. I did a search on the internet and cannot find much. Maybe code to cache any time of cache would help for me to look at. I am using Xcode 13.4.1, and my app is intended to install on iOS 12.0 up to the most current iOS version. I seem to remember a search class in one of Apple's frameworks for iOS. I don't remember if that was part of the Contacts Framework. I also will have a cache for the Contacts data that I store in CloudKit, so I take that into account to be looking for any way that might make the Contacts cache and the CloudKit cache work together.
0
0
707
Aug ’22
a problem when subclassing CNContact using swift
Hello There; Using macOS 12.5 & Xcode 13.4 I am trying to subclass CNContact and bumping into an issue that I do not understand! class MyContact: CNContact { var newVariable :String = "" ... } I have loaded contactArray:[CNContact] now as I iterate over this array I would like to typecast the instance of CNContact to an instance of MyContact. for thisContact in contactArray { if let myK:MyContact = thisContact as? MyContact { //do something } } program flow simply never proceeds into the if let statement... if I try to force this issue: let myK:MyContact = thisContact as! MyContact I get the error: Could not cast value of type 'CNContact' (0x2057a35b8) to 'XYZ.MyContact' (0x102484490). Please help me accomplish my goal - what am I not understanding here? All help appreciated! Steve
1
1
1k
Aug ’22
CKError 429 from CloudKit, using CKDiscoverAllUserIdentitiesOperation
I am working with the CKDiscoverAllUserIdentitiesOperation. I would like to fetch all users, however, CloudKit returns the following error: <CKError 0x6000009ce040: "Request Rate Limited" (7/2058); "Operation throttled by previous server http 429 reply. Retry after 6432.8 seconds. (Other operations may be allowed.)"; Retry after 6432.8 seconds> Here's my code: var identities = [CKUserIdentity]() let operation = CKDiscoverAllUserIdentitiesOperation() operation.userIdentityDiscoveredBlock = { userIdentity in identities.append(userIdentity) } operation.discoverAllUserIdentitiesCompletionBlock = { error in if let error = error { fatalError(error.localizedDescription) } else { completion(identities) } } operation.qualityOfService = .userInitiated CKContainer.default().add(operation) App adds that operation in the viewDidAppear method . Also I have requested to the application permission for user discoverability (accodring to the Apple's documentation: https://developer.apple.com/documentation/cloudkit/ckdiscoveralluseridentitiesoperato)
Replies
1
Boosts
0
Views
1.3k
Activity
Dec ’22
What size image to programmatically add to a contact such that it'll appear on the call screen nicely?
I want to programmatically create a contact with an image with the result that when the iPhone receives a call from the number associated with that contact its image will appear on the incoming call screen (occupying the full screen, not the little tiny icon variation). But I'm having a hell of a job trying to figure out what dimensions should be used for the image to add to the contact. If on the iPhone I take a screenshot and add that manually to a contact then make a call, then the call screen more or less displays the entire screenshot almost the same as the actual desktop. The call screen appears to be slightly magnifying the image. So whatever size the screenshot is should be close enough for the contact image. I've got an iPhone 14 pro and its UIScreen.main.bounds is 932 by 430. If I export an iPhone screenshot to a Mac, I can see its image size is 2796 by 1290, which is exactly 3 times the bounds size. So I created an image of size 2796 by 1290 and programmatically added it to a contact (using CNMutableContact.imageData = myUIImage.pngData(). But when a call arrives the image that gets displayed on the call screen is way way way out of whack and alignment. Same too if I add am image of size 932 by 430 (i.e. without the 3 times factor). I've done lots of experiments but I just can't figure out what size image I should add to the contact. Does anybody happen to know? (I exported the contact where I manually added the screenshot image as a .vcf to see what image size they use, but it doesn't export the full image that's actually displayed during a call screen, it just exports a truncation of the full image which is a square of 1200 by 1200.)
Replies
0
Boosts
0
Views
918
Activity
Dec ’22
Adding or using Note Field Access Entitlement
Hello, Ive ben having an issue with one of my Apps since Ventura came out. The app won't create a new contact It fails giving a few different warnings but no real error. I have tried it unto Ventura 13.0.1 (22A400) The error is 2022-12-03 09:33:54.543143+1000 **** [1941:15105] [api] Attempt to write notes by an unentitled app 2022-12-03 09:33:54.580714+1000 **** [1941:15105] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-12-03 09:33:54.580765+1000  **** [1941:15105] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-12-03 09:33:54.581969+1000 **** [1941:15105] [ABCDContact] An ABCDRecord is being saved without having a container assignment. Assigning the contact to <CNCDContainer 0x6000013c92c0 ab>. Please remember to assign contacts to containers to avoid recurring container lookup and contact re-validation costs. . When I follow the instructions on this page https://developer.apple.com/documentation/contacts to create a new contact It fails on Ventura to create a new contact and I don't know why. So I submitted a feedback Assistant request (FB11721907) But I also went ahead and got Notes field access as that was one of the warnings. That got approved, Now I would like help adding it in my project. I logged into the Developer Portal and in Identifiers, located my app and went to Additional Capabilities ticked the Box marked Contacts Notes Field Access. Then instructions in the email say 'Once you’ve finished generating the profile, you can use it in Xcode like any other manually-generated profile.' Im not sure what this means. I tried to add 'com.apple.developer.contacts.notes' Boolean, YES, to the entitlement file as described in https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_contacts_notes but the app doesn't launch when it's added. And if I put it into the info.plist file it does nothing. Also im not sure how to add the purpose string.
Replies
1
Boosts
0
Views
2.2k
Activity
Dec ’22
Has anyone figured out how to create a CNContainer in an iOS device?
Apple Documentation says that there is only one CNContainer in an iOS device of type local. Creating a container of type exchange requires using Exchange, and creating a container of type cardDAV requires a server also. Is there any way to create a container of type unassigned? I would need to do this programmatically in Swift to use in my iOS app. This question and the posts it mentions give no answer.
Replies
2
Boosts
0
Views
2k
Activity
Dec ’22
CNContactPickerViewController long Press on the contact name behaviour is different from iOS 15 and iOS 16
in iOS 15 in CNContactPickerViewController after long press on the contact and then selecting the contact it's navigating to the the specific contact details Please check the reference video: https://www.dropbox.com/s/6z5l4kz37rapbus/iOS_15_Behavior.MP4?dl=0 in iOS 16 in CNContactPickerViewController after long press on the contact and then selecting the contact it simply closing the picker Please check the reference video: https://www.dropbox.com/s/qu861la3dikxugq/iOS_16_Behavior.MP4?dl=0 Why this change ? Is it possible same behaviour in iOS 16 also ? is there any supporting documentation about this ?
Replies
0
Boosts
0
Views
862
Activity
Nov ’22
You must complete the Contact Information section
Hello I have filled all contact info and I can't still Submit app for review. "Unable to Submit for Review The items below are required to start the review process: You must complete the Contact Information section." All mails and numbers have I right. Thank you
Replies
2
Boosts
0
Views
5.3k
Activity
Nov ’22
[iOS] Search LDAP contacts
I had a need to display and search for contacts from my LDAP server. Seems the most efficient solution is to connect my Device (Application Contact) with my LDAP server. And with the Contacts framework I will be able to fetch all Local contacts including my LDAP contacts. Is there a solution to know from the CNContact if this contact is among my LDAP Contacts or other (Local, iCloud,..) If you have another solution how to search on my LDAP contacts do not hesitate to suggest me. OpenDirectory is not available on iOS Thanks
Replies
0
Boosts
0
Views
1.3k
Activity
Nov ’22
adding address to contacts on macOS
Apple itself offers a nice piece of code for adding own addresses to "Contacts"-App. (see documentation for "Contacts" - Listing 1 Creating a contact) I try to use this code. But when executing this, my app crashes with error on saving the data. (see image) My code so far: import AppKit import Contacts class ContactsClass { func addToContacts( lastName: String, firstName: String, birthDate: Date?, mail: String = "", phone1: String = "", phone2: String = "", mobile: String = "", street: String, city: String, postCode: String ) { // Create a mutable object to add to the contact let contact = CNMutableContact() contact.givenName = firstName contact.familyName = lastName if mail != "" { let homeEmail = CNLabeledValue(label: CNLabelHome, value: mail as NSString) contact.emailAddresses = [homeEmail] } contact.phoneNumbers = [] if phone1 != "" { contact.phoneNumbers.append(CNLabeledValue(label: CNLabelPhoneNumberMain, value: CNPhoneNumber(stringValue: phone1))) } if phone2 != "" { contact.phoneNumbers.append(CNLabeledValue(label: CNLabelPhoneNumberMain, value: CNPhoneNumber(stringValue: phone2))) } if mobile != "" { contact.phoneNumbers.append(CNLabeledValue(label: CNLabelPhoneNumberMobile, value: CNPhoneNumber(stringValue: mobile))) } let homeAddress = CNMutablePostalAddress() homeAddress.street = street homeAddress.city = city homeAddress.postalCode = postCode contact.postalAddresses = [CNLabeledValue(label: CNLabelHome, value: homeAddress)] if birthDate != nil { let calendar = Calendar.current let dateComponents = calendar.dateComponents([.year,.month,.day], from: birthDate!) var birthday = DateComponents() birthday.day = dateComponents.day birthday.month = dateComponents.month birthday.year = dateComponents.year // (Optional) Omit the year value for a yearless birthday contact.birthday = birthday } // Save the newly created contact let store = CNContactStore() let saveRequest = CNSaveRequest() saveRequest.add(contact, toContainerWithIdentifier: nil) do { try store.execute(saveRequest) // <<-- Error appears here!! } catch { print("Saving contact failed, error: \(error)") // Handle the error } } } Console errors are: 2022-10-28 06:26:03.473439+0200 justCare[11808:992463] [api] Attempt to write notes by a pre-Fall-2022 app 2022-10-28 06:26:03.499714+0200 justCare[11808:992463] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-10-28 06:26:03.499770+0200 justCare[11808:992463] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-10-28 06:26:03.500823+0200 justCare[11808:992463] [ABCDContact] An ABCDRecord is being saved without having a container assignment. Assigning the contact to <CNCDContainer 0x600001f9bba0 ab>. Please remember to assign contacts to containers to avoid recurring container lookup and contact re-validation costs. Access to Contatcs is granted. Sandboxing is properly set for Contacts. So why this error now? Environment: macOS Ventura XCODE 14.0.1
Replies
3
Boosts
0
Views
1k
Activity
Nov ’22
XCODE requesting access to save new contact Mac Catalyst
Im having trouble requesting access to save a new contact as of today with updating to Ventura 13.0 (22A380). Im requesting access to contacts using @IBAction func requestConactsAccess() {         CNContactStore().requestAccess(for: .contacts) { granted, error in             if granted {                 // Yes                 print("Granted")                 self.authStatusLabel.text = "Granted"             } else {                 // No                 print("Denied")                 self.authStatusLabel.text = "denied"             }         }     } But it is just being automatically denied. I can't save a contact either with an app that previously had permission. I created a small app to test this from scratch using the documentation "Working with the user’s contacts" https://developer.apple.com/documentation/contacts?language=objc I have been doing this since the first version of the app, Ive never had an issue Has something changed with regards to Requesting access to contacts in latest OS? https://developer.apple.com/documentation/contacts/requesting_authorization_to_access_contacts Thank you.
Replies
2
Boosts
0
Views
1.1k
Activity
Nov ’22
VALUE on call screen
Hi Everybody, while my colleaque call me from his iphone 12 Pro Max / ios 16.1(20B82) Screen has a unknown field "VALUE" is calling Does anybody have idea about what is the VALUE field? Thanks for the contribution
Replies
1
Boosts
0
Views
770
Activity
Nov ’22
Update "preferred line" for dual-SIM devices
I am developing an application which manages contacts on iDevices. One of the attributes of a contact I would like to update is the "preferred line", a SIM to be used when calling/texting the specified contact. I've studied all available APIs to update contacts, https://developer.apple.com/documentation/contacts, but unfortunately there seems to be no way of updating the attribute I need - "preferred line". Such functionality exists on the iOS Contacts application, but seems not exposed through the SDK. Have I missed it, and such functionality exists? If no, are there plans to add such support? Thanks in advance for your kind response.
Replies
0
Boosts
0
Views
1k
Activity
Nov ’22
CNSaveRequest without having a container assignment
Hi, When creating a new contact on MacOS Im getting this new error causing my app to crash, on my app only after updating my machine to Ventura 13.0. The last error before (lldb) is "An ABCDRecord is being saved without having a container assignment. Assigning the contact to <CNCDContainer 0x6000039b51a0 ab>. Please remember to assign contacts to containers to avoid recurring container lookup and contact re-validation costs." When saving a new contact I’m using  saveRequest.add(contact, toContainerWithIdentifier: nil)             do {                 try contactsStore.execute(saveRequest) ** I guess it does not like the nil. Am I supposed to add to a particular container, like iCloud? Documentation says to set it to nil - https://developer.apple.com/documentation/contacts/cnsaverequest/1403036-add Even with the most basic example from https://developer.apple.com/documentation/contacts the save request falis.
Replies
4
Boosts
1
Views
1.8k
Activity
Oct ’22
Contacts inaccessible on iOS 16.1 for Widget Extensions
In iOS 15 and 16, once an app gave permission to access Contacts, Widgets (and Lock Screen Widgets in iOS 16) could access Contacts. 16.1 beta 1 and 2 apparently no longer allow this (and there appears to be no work around, as Widgets can't ask you for permission separately from the parent app). My app (Curmmunicate) in the App Store will fail if this doesn't get a fix as it relies on this feature. Have filed a report: FB11563817 (Contacts not accessible from Widgets in iOS 16.1 betas). Report includes an Xcode sample project showing the issue.
Replies
4
Boosts
1
Views
1.5k
Activity
Oct ’22
currentHistoryToken Across Devices
when a user changes devices, but each device is on the same iCloud account, does the currentHistoryToken supplied by CNFetchResult from the old device still work on the new device? or must we conduct a full analysis from scratch?
Replies
0
Boosts
0
Views
644
Activity
Sep ’22
How many local CNContainers are on any single iOS device?
Is there always only one local CNContainer on any iOS device whether the user is logged in to iCloud or not, and whether the device is an iPhone or an iPad?
Replies
0
Boosts
0
Views
685
Activity
Sep ’22
usernotifications.filtering entitlement prevents a contact with an image from being added/updated
My notification service extension has the com.apple.developer.usernotifications.filtering entitlement and it would appear that this is preventing a contact with an image from either being added or updated, any attempt to do so results in calls to CNContactStore.execute() throwing an CNInvalidRecords error. If the filtering entitlement is removed then there are no problems and the contact can be added/updated without problem. If the entitlement is present but the contact is added/updated without an image then it is also problem free. It is specifically adding a contact with an image that cannot be accomplished if the entitlement is present. I've encountered problems with this entitlement before - for example there are problems attempting to use a CXCallDirectoryManager from within a notification service extension with this extension. Quote from Apple on the call extension issue: "Because that entitlement can "hide" notifications, its sandbox profile is actually more restrictive than the standard NSE sandbox. That's what's preventing access to CXCallDirectoryManager, not the App ID properties.  -Kevin Elliott DTS Engineer, CoreOS/Hardware" I'd be appreciative if somebody from Apple could comment and confirm if the problems with updating contacts with an image with this entitlement is the same fundamental sandboxing issue? If so, I don't understand why a contact can be added with this entitlement, its only an issue if the contact has an image, does that imply a bug?
Replies
1
Boosts
0
Views
1.1k
Activity
Sep ’22
How to fetch all contact on MacOS ?
Hello folks, I'm trying to fetch all contact from MacOS using the contact frameworks, but the documentation doesn't explain how to do it. So i'm searching for code in Swift or Objective-C (or anything else) to accomplish that.
Replies
3
Boosts
1
Views
1.2k
Activity
Sep ’22
vcf file not giving option to save contact is it default behaviour that have been changed in ios13
I have been using your one of package https://packagist.org/packages/jeroendesloovere/vcardto generate the vcf file to save the contact in phone contact and it was working fine earlier.but now I think there are something changes in ios13 or what but now when vcf file downloads in the iPhone it's not opening the correct screen.is there anything we can do to open up the screen with the save option
Replies
1
Boosts
0
Views
1.1k
Activity
Aug ’22
How to cache Contacts in iOS?
I want to check if my code to cache contacts data while my iOS app is running is done well or not. Anyone have any samples I can look at. I did a search on the internet and cannot find much. Maybe code to cache any time of cache would help for me to look at. I am using Xcode 13.4.1, and my app is intended to install on iOS 12.0 up to the most current iOS version. I seem to remember a search class in one of Apple's frameworks for iOS. I don't remember if that was part of the Contacts Framework. I also will have a cache for the Contacts data that I store in CloudKit, so I take that into account to be looking for any way that might make the Contacts cache and the CloudKit cache work together.
Replies
0
Boosts
0
Views
707
Activity
Aug ’22
a problem when subclassing CNContact using swift
Hello There; Using macOS 12.5 & Xcode 13.4 I am trying to subclass CNContact and bumping into an issue that I do not understand! class MyContact: CNContact { var newVariable :String = "" ... } I have loaded contactArray:[CNContact] now as I iterate over this array I would like to typecast the instance of CNContact to an instance of MyContact. for thisContact in contactArray { if let myK:MyContact = thisContact as? MyContact { //do something } } program flow simply never proceeds into the if let statement... if I try to force this issue: let myK:MyContact = thisContact as! MyContact I get the error: Could not cast value of type 'CNContact' (0x2057a35b8) to 'XYZ.MyContact' (0x102484490). Please help me accomplish my goal - what am I not understanding here? All help appreciated! Steve
Replies
1
Boosts
1
Views
1k
Activity
Aug ’22