Contacts

RSS for tag

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

Contacts Documentation

Posts under Contacts tag

39 Posts
Sort by:
Post not yet marked as solved
2 Replies
432 Views
I had requested for Contact Note Field Access Entitlement (via https://developer.apple.com/contact/request/contact-note-field) and got it enabled in app id's additional capabilities section. I have created app store distribution provisioning profile using this app id. And also added "com.apple.developer.contacts.notes YES" in entitlements file. But I'm getting the below error in xcode. I'm not able to archive the build because of this. How can I resolve this issue?
Posted Last updated
.
Post not yet marked as solved
0 Replies
256 Views
I need to be able to identify a CNContact so as to associate it with a CKRecord in a iCloud private database. If I use a non-unified contact, would the identifier be unique across all existing iOS devices so that I could store the identifier property in a record in the user's iCloud private database to identify a specific contact? The documentation says that the identifier of a CNContact stored object is unique within the device. If I use a UUID value and store it in the iCloud private database to identify the specific contact, how would I match that with the contact? I would need to save that UUID value as part of the contact object as stored in the contact store. Is that possible without saving the UUID value in the notes property of the contact. It would be better if I could store the UUID value somewhere where the user could not access it and delete or edit it. Is there a way to make the notes property of a contact inaccessible to the user where even if he/she could see it, he would not be able to change it? I'm not very familiar with the hash and hashValue properties of NSObject object. Though unlikely, would one of those properties be able to identify a contact uniquely across all existing iOS devices so that I could store it in the user's iCloud private database in order to associate a certain record in that database with a specific contact?
Posted Last updated
.
Post not yet marked as solved
0 Replies
271 Views
This is how I request contacts framework access permission -(void)askUserToAccessContacts {   @try   {     if([CNContactStore class])     {       //iOS 9 or later       CNEntityType entityType = CNEntityTypeContacts;       if( [CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusNotDetermined)       {         CNContactStore * contactStore = [[CNContactStore alloc] init];         [contactStore requestAccessForEntityType:entityType completionHandler:^(BOOL granted, NSError * _Nullable error) {           if(granted){             DDLogVerbose(@"Permission granted for Contacts access...");           }         }];       }       else if( [CNContactStore authorizationStatusForEntityType:entityType]== CNAuthorizationStatusAuthorized)       {         DDLogVerbose(@"Permission granted for Contacts access !!!");       }       else       {         DDLogVerbose(@"Permission not granted for Contacts access !!!");       }     }         } @catch (NSException *exception) {           [[WriteLogger getWriteLogger] writeLog:@"AppDelegate" sourceClass:NSStringFromClass([self class]) methodName:NSStringFromSelector(_cmd) exception:exception exceptionDict:nil];   } } What could possibly cause the app to crash? By the way, this crash is not occurring all the time, it happens randomly when I install the app and launch it for the first time. Incident Identifier: 33DC6088-0DC6-40A1-91E5-F7A76E3154EB Hardware Model: iPhone12,8 Version: 21.10.0 (0.5.2) AppStoreTools: 13C90b AppVariant: 1:iPhone12,8:15 Beta: YES Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Date/Time: 2022-01-10 11:43:38.9707 +0530 Launch Time: 2022-01-10 11:43:17.9333 +0530 OS Version: iPhone OS 15.1 (19B74) Release Type: User Baseband Version: 3.00.00 Report Version: 104 Exception Type: EXC_CRASH (SIGKILL) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Triggered by Thread: 0 Kernel Triage: VM - pmap_enter failed with resource shortage VM - pmap_enter failed with resource shortage VM - pmap_enter failed with resource shortage VM - pmap_enter failed with resource shortage VM - pmap_enter failed with resource shortage Thread 0 name: Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000001b73d0504 mach_msg_trap + 8 1 libsystem_kernel.dylib 0x00000001b73d0b9c mach_msg + 76 (mach_msg.c:119) 2 libdispatch.dylib 0x000000018019127c _dispatch_mach_send_and_wait_for_reply + 520 (mach.c:815) 3 libdispatch.dylib 0x000000018019162c dispatch_mach_send_with_result_and_wait_for_reply + 56 (mach.c:2019) 4 libxpc.dylib 0x00000001f083eb9c xpc_connection_send_message_with_reply_sync + 240 (connection.c:974) 5 TCC 0x00000001e78bb0c0 tccd_send_message + 940 (TCC.c:490) 6 TCC 0x00000001e78c0e08 __TCCAccessRequest_block_invoke.213 + 876 (TCC.c:591) 7 libdispatch.dylib 0x0000000180176660 _dispatch_client_callout + 20 (object.m:560) 8 libdispatch.dylib 0x00000001801858b4 _dispatch_lane_barrier_sync_invoke_and_complete + 56 (queue.c:1016) 9 libsystem_trace.dylib 0x000000019ac86668 _os_activity_initiate_impl + 64 (activity.c:131) 10 TCC 0x00000001e78bc4e0 TCCAccessRequest + 476 (TCC.c:1019) 11 TCC 0x00000001e78ba8b8 TCCAccessRestricted + 228 (TCC.c:1682) 12 ContactsFoundation 0x000000018ce4a6ec -[CNTCCVersion2 isAuthorizationRestricted] + 96 (CNTCCVersion2.m:79) 13 ContactsFoundation 0x000000018ce034a4 -[CNAuthorizationContext isAccessRestricted] + 52 (CNAuthorizationContext.m:90) 14 Contacts 0x0000000185c42b04 +[CNAuthorization isAccessRestrictedForEntityType:] + 72 (CNAuthorization.m:26) 15 Contacts 0x0000000185c5ba30 +[CNAuthorization authorizationStatusForEntityType:] + 40 (CNAuthorization.m:66) 16 ios_app 0x00000001024bc724 -[MainAppDelegate askUserToAccessContacts] + 84 (MainAppDelegate.m:1338) 17 ios_app 0x00000001024b61b8 -[MainAppDelegate application:didFinishLaunchingWithOptions:] + 1520 (MainAppDelegate.m:228) log.crash
Posted
by mohamed.t.
Last updated
.
Post not yet marked as solved
0 Replies
230 Views
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.
Posted Last updated
.
Post not yet marked as solved
1 Replies
306 Views
Xcode 13.2 Using CNContact seeing the error in the log: ... [framework] Resetting database at nil path is not allowed .... What does this mean? What causes this to happen? How do I avoid this? Any help appreciated! Steve
Posted
by SwampDog.
Last updated
.
Post not yet marked as solved
0 Replies
353 Views
I'm trying to break through focus mode in my app that receives VOIP notifications. I've added a particular contact to the "allowlist" for a particular focus mode. When I receive a call from my app, I create an INStartCallIntent. To create the INPerson, I use an INPersonHandle with the value being the identifier that I fetch from the contact. There are also 2 other identifier fields in INPerson that are both nullable (contactIdentifier and customIdentifier). I've also tried populating those with the fetched contact's identifier. Here's my general prototyped code (yes I know this is all hard coded, but it's just a prototype for now).      INPersonHandle *handle = [[INPersonHandle alloc] initWithValue:identifier type:INPersonHandleTypeUnknown];     INPerson *caller = [[INPerson alloc] initWithPersonHandle:handle                           nameComponents:nameComponents                            displayName:name                               image:nil                         contactIdentifier:identifier                          customIdentifier:nil                        isContactSuggestion:NO                           suggestionType:INPersonSuggestionTypeSocialProfile];     NSDate *_Nonnull dateCreated = [NSDate date];     INCallRecord *const callRecord = [[INCallRecord alloc] initWithIdentifier:callId                                    dateCreated:dateCreated                                   callRecordType:INCallRecordTypeRinging                                   callCapability:callCapability                                    callDuration:nil                                       unseen:nil                                    participants:@[caller]                                   numberOfCalls:@(1)                                 isCallerIdBlocked:nil];     INStartCallIntent *const intent = [[INStartCallIntent alloc] initWithCallRecordFilter:nil                                      callRecordToCallBack:callRecord                                           audioRoute:INCallAudioRouteSpeakerphoneAudioRoute                                        destinationType:INCallDestinationTypeNormal                                            contacts:@[caller]                                         callCapability:callCapability];     // Donate the interaction to Siri     INInteraction *const interaction = [[INInteraction alloc] initWithIntent:intent response:nil];     interaction.direction = INInteractionDirectionIncoming;     [interaction donateInteractionWithCompletion:nil]; Nothing I've tried yet has been able to break through focus mode and I think it's because the identifiers aren't matching up. Apple seems to have a clear way to match contacts for email address and phone number identifiers, but it's unclear how they match based on an unknown type for the INPersonHandleType.
Posted
by plzhelp.
Last updated
.
Post not yet marked as solved
1 Replies
339 Views
I noticed that when my app changes the contact store, the CNContactStoreDidChange notification fires in my app. How do I check if the notification fired because my app changed it. Is there a way to know which app made the change to the contact store. I need to know so I can write code to run only if the contact store was changed by another app instead of my app.
Posted Last updated
.
Post not yet marked as solved
0 Replies
269 Views
I am writing an iOS app using Swift and Xcode 13.1. I am using the Contacts Framework, and I read that each app has a default contacts container, and the default container in an app can be different than the default container in another app, and there is not a default container for the entire device. What determines which is the default container for the app made by an Xcode project? I didn't set the default container for my app and somehow the contacts container for a Google account became the default contacts container for my app. How do I use code to set the default contacts container for my app? How do I find out which is the default container of Apple's Contacts app that comes with iOS? I would like to set my app's default contacts container to the same default container of Apple's Contacts app, if that is the contacts container that is saved on iCloud. If not, I would like to set my app's default contacts container to the contacts container that is saved in iCloud. I assume that only one contacts container is saved on iCloud.
Posted Last updated
.
Post not yet marked as solved
0 Replies
290 Views
Hi, I encountered a crash that happens randomly on certain macOS. Here's the crash log. For clarity, only the crashed queue's stack trace is added. Process: Engage [6891] Path: /Applications/Engage.app/Contents/MacOS/Engage Identifier: com.mycompany.engage Version: 2.0.1 (20111120) Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Engage [6891] User ID: 2123560928 Date/Time: 2021-11-17 16:36:20.753 +0800 OS Version: Mac OS X 10.14.6 (18G9323) Report Version: 12 Anonymous UUID: C642EE95-AF30-723E-91B8-A1C9D4ECD9A6 Sleep/Wake UUID: B95DB75A-69E8-4F19-B735-CEC7A698AE00 Time Awake Since Boot: 40000 seconds Time Since Wake: 910 seconds System Integrity Protection: enabled Crashed Thread: 5 Dispatch queue: Contacts fetching queue Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Illegal instruction: 4 Termination Reason: Namespace SIGNAL, Code 0x4 Terminating Process: exc handler [6891] Application Specific Information: API MISUSE: Resurrection of an object Thread 0:: Dispatch queue: com.apple.main-thread ... Thread 1: ... Thread 2: ... Thread 3: ... Thread 4:: Dispatch queue: com.apple.root.background-qos ... Thread 5 Crashed:: Dispatch queue: Contacts fetching queue 0 libdispatch.dylib 0x00007fff703929a6 _os_object_retain + 34 1 com.apple.AppKit 0x00007fff41bbc6da -[_NSWorkspaceFileOperation initWithQueue:URLs:operation:completionHandler:] + 111 2 com.apple.AppKit 0x00007fff41bbc5a0 -[NSWorkspace recycleURLs:completionHandler:] + 726 3 com.apple.AddressBook.core 0x00007fff53cd5004 -[ABPersistentStoreBuilder removeDotNewPathForDatabasePath] + 212 4 com.apple.AddressBook.core 0x00007fff53cd42f3 -[ABPersistentStoreBuilder addPersistentStoreAtDatabasePath:] + 61 5 com.apple.AddressBook.core 0x00007fff53cd3da4 -[ABPersistentStoreCoordinatorFactory addStoresForAccounts:withStoreBuilder:] + 333 6 com.apple.AddressBook.core 0x00007fff53cccd7f -[ABPersistentStoreCoordinatorFactory pool_makeCoordinatorForAllAvailableSources] + 114 7 com.apple.AddressBook.core 0x00007fff53ccccc1 ABResultWithAutoreleasePool + 59 8 com.apple.AddressBook.core 0x00007fff53cccc80 -[ABPersistentStoreCoordinatorFactory makeCoordinatorForAllAvailableSources] + 65 9 com.apple.AddressBook.core 0x00007fff53ccca4c -[ABPersistentStoreCoordinatorMap nts_coordinatorForAllSourcesAndDidUpdateMap:] + 114 10 com.apple.AddressBook.core 0x00007fff53ccc99d -[ABPersistentStoreCoordinatorCache coordinatorForAllSources] + 55 11 com.apple.AddressBook.core 0x00007fff53ccc777 -[ABAddressBook(ABAddressBook_CoreData_Private) nts_managedObjectContextWithStoreDescription:databasePath:loadFailure:] + 288 12 com.apple.AddressBook.core 0x00007fff53ccc377 -[ABAddressBook(ABAddressBook_CoreData_Private) managedObjectContext] + 109 13 com.apple.AddressBook.core 0x00007fff53ccc2c0 __38+[ABAddressBook nts_SharedAddressBook]_block_invoke + 24 14 com.apple.AddressBook.core 0x00007fff53ccc257 ABRunWithLock + 32 15 com.apple.AddressBook.core 0x00007fff53cc8873 +[ABAddressBook nts_SharedAddressBook] + 137 16 com.apple.AddressBook.core 0x00007fff53cc8747 +[ABAddressBook nts_CreateSharedAddressBook] + 47 17 com.apple.AddressBook.core 0x00007fff53cc817e +[ABAddressBook sharedAddressBook] + 81 18 com.apple.contacts.ContactsPersistence 0x00007fff572427ee -[CNCDPersistenceStack makePersistenceContext] + 27 19 com.apple.contacts 0x00007fff43d048dd __71+[CNCDContactFetcher contactsForFetchRequest:inPersistenceStack:error:]_block_invoke + 73 20 com.apple.AddressBook.ContactsFoundation 0x00007fff571e407a +[CNEither eitherWithBlock:] + 63 21 com.apple.contacts 0x00007fff43d047e1 +[CNCDContactFetcher contactsForFetchRequest:inPersistenceStack:error:] + 147 22 com.apple.contacts 0x00007fff43d0462a -[CNCoreDataMapperX contactObservableForFetchRequest:] + 137 23 com.apple.contacts 0x00007fff43d03fc3 __91-[CNDataMapperContactStore enumerateContactsAndMatchInfoWithFetchRequest:error:usingBlock:]_block_invoke + 172 24 libsystem_trace.dylib 0x00007fff705f6724 os_activity_apply_f + 66 25 com.apple.contacts 0x00007fff43d03ed8 -[_CNContactsLogger fetchingContacts:] + 225 26 com.apple.contacts 0x00007fff43d03cee -[CNDataMapperContactStore enumerateContactsAndMatchInfoWithFetchRequest:error:usingBlock:] + 304 27 com.apple.contacts 0x00007fff43d16d6e -[CNContactStore enumerateContactsWithFetchRequest:error:usingBlock:] + 149 28 com.mycompany.engage 0x00000001076181f4 0x1074c6000 + 1384948 29 com.mycompany.engage 0x00000001076548ce 0x1074c6000 + 1632462 30 libdispatch.dylib 0x00007fff703925f8 _dispatch_call_block_and_release + 12 31 libdispatch.dylib 0x00007fff7039363d _dispatch_client_callout + 8 32 libdispatch.dylib 0x00007fff703998e0 _dispatch_lane_serial_drain + 602 33 libdispatch.dylib 0x00007fff7039a396 _dispatch_lane_invoke + 385 34 libdispatch.dylib 0x00007fff703a26ed _dispatch_workloop_worker_thread + 598 35 libsystem_pthread.dylib 0x00007fff705d3611 _pthread_wqthread + 421 36 libsystem_pthread.dylib 0x00007fff705d33fd start_wqthread + 13 Thread 6: ... In the stack trace, two lines that are related to my app 28 com.mycompany.engage 0x00000001076181f4 0x1074c6000 + 1384948 29 com.mycompany.engage 0x00000001076548ce 0x1074c6000 + 1632462 It just call the enumerateContacts(with: fetchRequest) on the instance of CNContactStore, and the fetchRequest is created using CNContactFetchRequest(keysToFetch: keysToFetch). Pretty straightforward. The stack trace goes into he Contacts framework, and then goes into the AddressBook framework, and eventually crashed. What could be the possible cause of the crash?
Posted
by powerqian.
Last updated
.
Post marked as solved
1 Replies
305 Views
When I use the Contacts Framework with Swift for iOS 15 using Xcode 13, when I use CNContactStore instance method unifiedContacts(matching:keysToFetch:), what happens to those CNContact objects that are not linked with any other CNContact objects, would they be returned as non-unified contacts, or would they be left out since they are non-unified contacts?
Posted Last updated
.
Post not yet marked as solved
0 Replies
241 Views
How do I use Swift in iOS to take a Group of Contacts and copy it all to another iOS device using a different Apple ID? I have looked into fetching the Contacts using CNContactStore, using the Share App Extension, and somehow using .vcf files. I'm looking for any ideas anyone has. Hopefully I can pick the simplest way to do this from someone's idea.
Posted
by Shinehah.
Last updated
.
Post not yet marked as solved
1 Replies
335 Views
Hi, I'm a project manager, not necessarily a developer so this will be a blunt, rookie question. We're working on an app, part of it includes adding our phone number to the user's contacts during onboarding. This phone number will be called by the user later when they need our service. Is there an easy or automated way to add convenience instead of having the user manually have to copy a number, and then create a contact?
Posted
by lotus61.
Last updated
.
Post not yet marked as solved
0 Replies
296 Views
Hi All, I want to generate QR code on Wallet pass which adds new contact to Address Book. I prepared .vcf file with contact data and sent it to iPhone, however the device only opened Address Book and nothing else happened. Do you have any idea how to fix it?
Posted
by 1gabriela.
Last updated
.
Post not yet marked as solved
4 Replies
1.1k Views
Watch OS8 is not syncing contacts. When I go to messages it will show group names but not the names of the individuals in the group. It will also not show single and nothing in contacts. I have contact syncing turned on. I have don't a restore and set up as new and issue remains. Anyone else having this issue?
Posted Last updated
.
Post not yet marked as solved
1 Replies
376 Views
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?
Posted Last updated
.
Post not yet marked as solved
3 Replies
718 Views
I think the image resizing process when creating the new contact is not done correctly. It's easy to understand if you create a vCard. [Steps] Take two pictures with the same subject. (Let "IMG_A" and "IMG_B".) Create a "New Contact". 2-1. Tap [Add Photo] and select "IMG_A". 2-2. Tap the [Choose] without doing anything in "Move and Scale". 2-3. Tap [Done] a few times to set the Photo. 2-4. Entering a name and other information is optional. 3. Save the contact as a vcf file to Files App. * [Share Contact] - [Save to Files] - [On My iPhone] - [Save] 4. Edit the contact that saved at step 2. 4-1. Release "IMG_A", and set the "IMG_B" in the same as the step 2-1 to 2-3. 5. Save the contact as a vcf file to Files app in the same as step 3. 6. Check the size of the two vcf files. [Result] The size of the two vcf files are very different. I think the cause is PHOTO property. As a result of extracting the image from vCard, the resolution was as follows. (Original: 3024 * 4032) IMG_A: 2784 * 2784 IMG_B: 320 * 320 [Remarks] I checked this issue occur iOS14(include new version of 14.4.2) and iOS12 is not occured.
Posted
by appf.
Last updated
.
Post not yet marked as solved
2 Replies
559 Views
Hi, I tried very hard to contact Apple through email since my apple developer account suddenly get a "Notice of Termination" email from Apple but Apple haven't response me 9 days ago. I'm really troubled with it. I even asked my friend to use his developer account to access to developer support portal but after receive a call from Apple, its just an automatic robot response try to make me press "1". After that Apple did call back but immediately hang up after 10 seconds ringing phone. Even if i tried to get it instantly, no one talks to me and ended up the call after 10-15 seconds. Tried like 10-15 calls and still unable to get Apple support to talk to me. What am i supposed to do to get Apple support me through phone number or email? They literally ignore me. Anyone know what is the best way to contact them?
Posted Last updated
.