Post not yet marked as solved
Hi,I saw the WWDC talk on the new Contacts framework, and I had a couple of questions about the identifier property:When users upgrade from iOS8 to iOS9, will their old AddressBook recordIDs still work if we are using the AddressBook framework in the app (i.e. haven't upgraded to using Contacts framework)?Are the new CNContact identifiers consistent across iOS and Mac devices? i.e. if we have the identifier on one device, we can lookup the contact on another device with the same identifier?Can these identifiers change in the lifetime of that contact? This was a problem with AddressBook recordIDs ... if you removed the account and then synced it back again, all the contacts would get a different identifier. Same with restoring the device. Will the CNGroup and CNContainer identifiers also be consistent across devices?Hope someone in the Apple Contacts frameworks team can answer. Thanks.
Post not yet marked as solved
We are developing an app that will show contact information - name, phone numbers, email addresses, and physical addresses. When I prepare screen shots and 30 second videos for the Apple App Store listing, for privacy, I want to avoid showing contact information from my own personal contacts.
I understand that someone (maybe an Apple engineer) developed a vCard file with 60 iPhone Demo Contacts with "John Appleseed" and others. Does anyone know how I can obtain a zip file for those Demo Contacts, or something similar, in English?
I understand the vCard file with 60 contacts was previously, but no longer, available for download as a 5.2 MB zip file on TUAW.
Post not yet marked as solved
I'm trying to remove a few languages which is present as the localized language in my app (under language section) in iTunes connect but when I try to remove it, it allows me to remove but when I try to save these changes Apple is prompting me an error message
"You have one or more errors on this page.
• An error has occurred. Try again later."
Can anyone, please let me know how can I remove a localized language?
Post not yet marked as solved
I've linked my contacts app on my iPhone to my company contacts database, and it shows up in the contacts app as "My Company Global Address List", and I can tap on it and search within it.
However using CNContactFetchRequest doesn't retrieve any of those contacts, is it something that's possible to do, if so how?
Post not yet marked as solved
Hi Team pls help with this cuz we've been stucking in the contact thing like a month...and we cant get any further progress. We have wrote like 10 emails with our phone numbers but still got no calls at all.
Post not yet marked as solved
Without exception, every single code example/tutorial for adding a contact group uses a nil container value i.e. the toContainerWithIdentifier parameter is nil, as below. I've not been able to find an example usage where it isn't nil.
let group = CNMutableGroup()
group.name = "whatever"
let saveRequest = CNSaveRequest()
saveRequest.add(group, toContainerWithIdentifier: nil)
do {
try store.execute(saveRequest)
} catch {
handle error
}
I've been running this code and 99.9% of the time it works as expected. However on one handset the catch is being executed with
Error Domain=CNErrorDomain Code=207 "Container is read-only"
How should I deal with this? How can I find out what container it is being added to? Why would it be read only?
If nil means add to the default container, why is the default container in this case read only?
How can I change the code that it will always run on every device? I've not been able to find any examples/tutorials for creating a custom container to which the group can be added.
Post not yet marked as solved
I use CNContactStore enumerateContacts to read all contacts, https://fburl.com/9plmcenx
Surprisedly, I cannot get contacts synced from Microsoft Office 365 using this API
from debug build, release build works.
I am wondering what might be the reason?
Contacts synced from gmail, or saved locally are read fine in both debug build and release build.
Post not yet marked as solved
Learn how to fetch and process the most recent changes to the Contacts database.
View Technote TN3149 >
Post not yet marked as solved
Hi! Every One.
I want to get user's name, image data on iPhone
I had two solution. but all of that failed.
First, I access Contacts, And then get just only my card. but cannot get my card. There is no idea that which is my card among all contacts. (CNContact.predicateForContacts(withIdentifiers:))
Second, I login with AppleID, And then get name and image data associated with AppleID. But I cannot get image data. (ASAuthorizationAppleIDCredential)
Could you help me?
Post not yet marked as solved
In the WWDC, there was a mention of the CallKit framework that it would be possible for 3rd party VoIP apps to create Posters programmatically. However, there are no new methods around this in the CallKit framework. Are we missing something?
Post not yet marked as solved
You can programatically get/set a picture and a thumbnail for a contact, however the new poster field added to iOS 17 apparently has no programatic access? I'm not able to see anything new being added to CNContact.h
Post not yet marked as solved
If I have located (or created) a CNContact record on one device (e.g., iPhone), and I want to retrieve that same record programmatically from another device (e.g., iPad or Mac), is there any unique id that identifies that record? The identifier property on CNContact seems to be assigned for the local replica of the contact record, but I don't believe it can be used to retrieve the record on another device (e.g., using unifiedContact(withIdentifier...). I can unifiedContact(matching...) but not guaranteed to get same record if there are multiples with same predicate property values.
I'm pretty new to Swift and CNContactStore, so sorry if I'm missing something obvious.
Post not yet marked as solved
Hi,
Im using the CNContactStore.currentHistory (available from iOS 13) to get token and check version of contacts. Everything is good til I try it on iOS 13 and iOS 14. Token is always nil from both ObjC and Swift.
Is it a bug? Or have any way to handle that instead?
Have any way to get token in iOS 13, 14?
Any help would be greatly appreciated. Thank you!
Post not yet marked as solved
Why did I get an error in playground in debug window for this code?
print("// MARK: - Start execable code here...")
do {
let store = CNContactStore()
if try await store.requestAccess(for: .contacts) {
// Do something with Contacts.
let phoneNumber = CNPhoneNumber(stringValue: "903-276-1046")
let predicateForContactsMatchingPhoneNumber = CNContact.predicateForContacts(matching: phoneNumber)
let contactFetchRequest = CNContactFetchRequest(keysToFetch: thoroughKeysToCompare)
contactFetchRequest.predicate = predicateForContactsMatchingPhoneNumber
contactFetchRequest.unifyResults = true
var contactOfMe: CNContact! = nil
try! store.enumerateContacts(with: contactFetchRequest) {
contact, stop in
contactOfMe = contact
stop.pointee = true
}
let contact = Contact(cnContact: contactOfMe)
for property in contact.enumerated() {
print("- \(property)")
}
} else {
// Handle if Contacts access is denied.
fatalError()
}
} catch {
// Handle any error.
print("error requesting access: \(error.localizedDescription)")
}
Debug window:
// MARK: - Start execable code here...
Playground execution failed:
error: Execution was interrupted, reason: shared-library-event.
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
* thread #1, queue = 'com.apple.main-thread'
frame #0: 0x00007ff80002f931 libobjc.A.dylib`_mapStrHash(_NXMapTable*, void const*) + 73
frame #1: 0x00007ff80002fc7f libobjc.A.dylib`_NXMapMember(_NXMapTable*, void const*, void**) + 35
frame #2: 0x00007ff80003b7ae libobjc.A.dylib`getProtocol(char const*) + 41
frame #3: 0x00007ff8000428e6 libobjc.A.dylib`class_conformsToProtocol + 337
frame #4: 0x00007ff80004ab4e libobjc.A.dylib`-[NSObject conformsToProtocol:] + 47
frame #5: 0x0000000109c27951 UIKitCore`_UIFocusItemContainerIsScrollableContainer + 74
frame #6: 0x0000000109c28e38 UIKitCore`-[_UIFocusEnvironmentContainerTuple initWithOwningEnvironment:itemContainer:] + 194
frame #7: 0x0000000109c28fed UIKitCore`+[_UIFocusEnvironmentContainerTuple tupleWithOwningEnvironment:itemContainer:] + 70
frame #8: 0x0000000109c4f41e UIKitCore`_UIFocusRegionContainerFromEnvironmentAndContainer + 44
frame #9: 0x0000000109c27ed3 UIKitCore`_UIFocusItemContainerAddChildItemsInContextWithArguments + 1162
frame #10: 0x000000010a99c439 UIKitCore`-[UIView _searchForFocusRegionsInContext:] + 962
frame #11: 0x0000000109c6b37f UIKitCore`-[_UIFocusMapSnapshot addRegionsInContainer:] + 4583
frame #12: 0x0000000109c69740 UIKitCore`-[_UIFocusMapSnapshot _capture] + 456
frame #13: 0x0000000109c67fc5 UIKitCore`-[_UIFocusMapSnapshot _initWithSnapshotter:mapArea:searchArea:] + 628
frame #14: 0x0000000109c6cce2 UIKitCore`-[_UIFocusMapSnapshotter captureSnapshot] + 227
frame #15: 0x0000000109c5f450 UIKitCore`-[_UIFocusMap _inferredDefaultFocusItemInEnvironment:] + 147
frame #16: 0x0000000109c2b1cf UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerationContext _inferPreferencesForEnvironment:] + 157
frame #17: 0x0000000109c2abbc UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerationContext _resolvePreferredFocusEnvironments] + 118
frame #18: 0x0000000109c2ab12 UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerationContext prefersNothingFocused] + 31
frame #19: 0x0000000109c2beeb UIKitCore`_enumeratePreferredFocusEnvironments + 198
frame #20: 0x0000000109c2c061 UIKitCore`_enumeratePreferredFocusEnvironments + 572
frame #21: 0x0000000109c2c061 UIKitCore`_enumeratePreferredFocusEnvironments + 572
frame #22: 0x0000000109c2c061 UIKitCore`_enumeratePreferredFocusEnvironments + 572
frame #23: 0x0000000109c2bd11 UIKitCore`-[_UIFocusEnvironmentPreferenceEnumerator enumeratePreferencesForEnvironment:usingBlock:] + 230
frame #24: 0x0000000109c2c747 UIKitCore`-[_UIDeepestPreferredEnvironmentSearch deepestPreferredFocusableItemForEnvironment:withRequest:] + 817
frame #25: 0x0000000109c95837 UIKitCore`-[UIFocusUpdateContext _updateDestinationItemIfNeeded] + 265
frame #26: 0x0000000109c95627 UIKitCore`-[UIFocusUpdateContext _destinationItemInfo] + 22
frame #27: 0x0000000109c95535 UIKitCore`-[UIFocusUpdateContext nextFocusedItem] + 24
frame #28: 0x0000000109c71ea6 UIKitCore`-[UIFocusSystem updateFocusIfNeeded] + 1347
frame #29: 0x0000000109c7608c UIKitCore`__43-[UIFocusSystem _updateFocusUpdateThrottle]_block_invoke + 34
frame #30: 0x000000010a94b971 UIKitCore`-[_UIAfterCACommitBlock run] + 57
frame #31: 0x000000010a94be71 UIKitCore`-[_UIAfterCACommitQueue flush] + 191
frame #32: 0x000000010a3926eb UIKitCore`_runAfterCACommitDeferredBlocks + 782
frame #33: 0x000000010a380fa2 UIKitCore`_cleanUpAfterCAFlushAndRunDeferredBlocks + 96
frame #34: 0x000000010a3b6be1 UIKitCore`_afterCACommitHandler + 58
frame #35: 0x00007ff8003b1c12 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
frame #36: 0x00007ff8003ac57f CoreFoundation`__CFRunLoopDoObservers + 515
frame #37: 0x00007ff8003acaa2 CoreFoundation`__CFRunLoopRun + 1121
frame #38: 0x00007ff8003ac264 CoreFoundation`CFRunLoopRunSpecific + 560
frame #39: 0x00007ff8003ad234 CoreFoundation`CFRunLoopRun + 40
frame #40: 0x00007ff83755a4e3 libswift_Concurrency.dylib`swift_task_asyncMainDrainQueueImpl() + 35
frame #41: 0x00007ff83755a4b4 libswift_Concurrency.dylib`swift_task_asyncMainDrainQueue + 52
frame #42: 0x00000001015d409f $__lldb_expr32`main at <unknown>:0
frame #43: 0x0000000100e25560 EnumeratedContactsCNContact`linkResources + 256
frame #44: 0x00007ff8003b2986 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
frame #45: 0x00007ff8003b2148 CoreFoundation`__CFRunLoopDoBlocks + 399
frame #46: 0x00007ff8003ace09 CoreFoundation`__CFRunLoopRun + 1992
frame #47: 0x00007ff8003ac264 CoreFoundation`CFRunLoopRunSpecific + 560
frame #48: 0x00007ff809b4024e GraphicsServices`GSEventRunModal + 139
frame #49: 0x000000010a3827bf UIKitCore`-[UIApplication _run] + 994
frame #50: 0x000000010a3875de UIKitCore`UIApplicationMain + 123
* frame #51: 0x0000000100e256c5 EnumeratedContactsCNContact`main + 357
frame #52: 0x0000000100fbb384 dyld_sim`start_sim + 10
frame #53: 0x000000010943341f dyld`start + 1903```
Post not yet marked as solved
Hi, we are using following setting in our web app to capture customer contact/shipping details:
we have selected "detailed request" from "Apple pay payment request"
It leads to parsing of following data:
However, we do not need the **postal address, ** just email and contact is enough.
The problem is in many cases users have not added a shipping address to their apple account, which leads to this screen in case they try to pay:
Is it possible to just ask users for "contact number" and "email address" and EXCLUDE asking shipping address which they might have not added, so the payment goes through even if the user has not updated the "address".
Post not yet marked as solved
On my iPhone, in Settings, I've added my company Exchange account. Consequently, within the Contacts app, 4 new lists appear - the bottom as shown in the attached image.
There's a few thousand contacts in the Company Exchange account, so why are the count values showing as 0? If I click on the Global Address list and search, it can succfully find whatever I search for. I want to programatically retrieve the contacts within the Exchange account, in addition to those stored locally or within iCloud, however if I execute the following code, for the container of type exchange, the count of results of the call to unifiedContacts() is 0.
How can I programatically get the Exchange contacts? If the call to unifiedContacts() is resulting in 0 because the count for the lists when viewing the Contacts app is 0, then how to make it not 0 in the Contacts app (but if that were the case, how come manually searching for a contact is successful?)
let keysToFetch = [
CNContactFormatter.descriptorForRequiredKeys(for: .fullName),
CNContactPhoneNumbersKey,
CNContactEmailAddressesKey,
CNContactThumbnailImageDataKey] as [Any]
var allContainers: [CNContainer] = []
do {
allContainers = try CNContactStore().containers(matching: nil)
} catch {
print("Error fetching containers")
}
var results: [CNContact] = []
for container in allContainers {
let type = container.type
let identifier = container.identifier
let fetchPredicate = CNContact.predicateForContactsInContainer(withIdentifier: container.identifier)
do {
let containerResults = try CNContactStore().unifiedContacts(matching: fetchPredicate, keysToFetch: keysToFetch as! [CNKeyDescriptor])
let count = containerResults.count
results.append(contentsOf: containerResults)
} catch {
print("Error fetching containers")
}
}
Post not yet marked as solved
Only used EventKit's calendarsForEntityType API, but a user trigger the address book privacy alert. Is it possible for EventKit to trigger the privacy alert of the address book?
Post not yet marked as solved
We use Eventkit Framework to synchronize the meeting calendar to the system calendar, read the System Calendar with -[EKEventStore calendarsForEntityType:], Use - [EKEventStore saveEvent: span: commit: error:] wrote system calendar. This usage currently triggers the Contacts Permission Alert on a user. Through the log, we identified no use - [CNContactStore requestAccessForEntityType: completionHandler:] and Contacts API.
Post not yet marked as solved
Hi, i have around 1600 contacts on my iphone but only 350 of them are in the icloud. how can i add them all. I got a new phone and only the 350 contacts transferred.
Post not yet marked as solved
Is your feature request related to a problem? Please describe.
Everywhere where Apple offers it, I use Apple's Private Relay e-mail addresses.
However, they can't be manually generated, so for the rest, I use https://anonaddy.me. Because it offers infinite aliases, I use a different alias every time I give my e-mail address to someone. However, I ensure that they're all under the @rokejulianlockhart.anonaddy.com (.com and .me are equivalent in this case) domain so that they can be identified as me by a human. I use different aliases to combat spam, not be anonymous.
Additionally, when messaging others, I ensure that I add a sub-address with my name to their e-mail address so that they can filter all messages from me (even if I'm using a different alias for my own filtering purposes). Others use the same when communicating with me, especially family. The current identification system doesn't take sub-addresses into account whatsoever.
Describe the solution you'd like
I should therefore be able to set
RY7I0I+RY7I0R@rokejulianlockhart.anonaddy.com as an e-mail address, and beneath it add, for instance
[A-Za-z0-9]+\+[A-Za-z0-9]+@rokejulianlockhart\.anonaddy\.com
in another input form to ensure that Nextcloud identifies any (in this case sub-addressed) alias as me.
Describe alternatives you've considered
The sole current alternative is to list literal tens of thousands of aliases as myself, which is insane. It also wouldn't work, because https://anonaddy.me generates a new alias when someone else uses one, so I'd have to retroactively add those whenever someone else uses one. It also wouldn't account for sub-addresses.
Additional context
Like most more powerful features of Nextcloud, this only need be visible when clicked on. Adding a button beside each e-mail address to show a form which allows the user to enter custom regex is enough.
Additionally requested at:
https://feedbackportal.microsoft.com/feedback/idea/ed4261f8-af28-ee11-a81c-6045bd8534ad.
https://discussions.apple.com/thread/255016441.
https://github.com/nextcloud/contacts/issues/3530#issue-1816825315.