abaddressbook

How whatsapp get updated contacts from addressbook faster in iOS?

主宰稳场 提交于 2019-12-05 18:02:08
问题 My findings I am designing a logic to sync contact with my Backend. I gone through some apps that doing same thing in IOS. I will take the example of WhatsApp, I found that When I update any contact in Native Addressbook, it reflect that change into Whatsapp withing a fraction. My Concern I just want to know that how it is syncing in a very faster way. Even a new contact gets synced with its Remote server and get displayed on contact, and with the ability to initiate Whatsapp chat if that

How do you access the current user's record in Address Book?

为君一笑 提交于 2019-12-05 09:45:45
Is there a way in the Address Book API to access the current user's record programatically? In other words, if this iPhone belongs to John Smith, to get the contact record that is John Smith (whichever record is marked as Me in Contacts)? Obviously you can popup the picker and let the user select themselves from their Contacts, but this seems like an unnecessary action for the user to take. Use case: I have a form in my app and I'd like to pre-populate the form for the user based on their contact info they've already entered. It would be nicer to just display this for them than make them go

ABRecordCopyValue and ABPropertyID crash

醉酒当歌 提交于 2019-12-05 08:53:45
问题 I'm trying to retrieve data from the iPhone address book and I have some problems. First of all, I have an array of all contacts ( self.allContacts ): ABAddressBookRef abRef = ABAddressBookCreate(); self.allContacts = (NSMutableArray*)ABAddressBookCopyArrayOfAllPeople(abRef); I also have an array of all properties (each property as string) called self.allKeys . The crash occurs when I try to get the properties using a property from self.allKeys : NSString *currentRecord = [[NSString alloc]

Swift filter array using NSPredicate

◇◆丶佛笑我妖孽 提交于 2019-12-05 07:45:49
I have an application written in Swift that is pulling in the users contacts from their address book. I want to filter out the contact that only contain a company name (so that you get your "assumed" real person contact and not businesses) Here is how this is being accomplish in the Objective-C version of my app: NSArray *allContacts = (__bridge_transfer NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook); NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(id person, NSDictionary *bindings) { NSString *firstName = CFBridgingRelease(ABRecordCopyValue((__bridge ABRecordRef

iPhone AddressBook - how to create a new record with app from my App

白昼怎懂夜的黑 提交于 2019-12-05 07:21:44
问题 I'm trying to create a new record of Person thru my App. I have the name, email and phone nr. How can i pass them to the modal view of newPerson? I'm following Apple's docs, but i'm stuck. I'm using a ABNewPersonViewController. Is that correct? How do I fill the fields in the modal view? Thanks, RL 回答1: If you want to display something in the ABNewPersonViewController, you have to create and set up an ABRecordRef for the properties you want to pre-fill and then set the displayedPerson

What are the Tags Around Default iPhone Address Book People Phone Number Labels?

安稳与你 提交于 2019-12-05 04:35:44
My question concerns markup that surrounds some of the default phone number labels in the Person entries of the Contact list on the iPhone. I have created an iPhone contact list address book entry for a person, "John Smith" with the following phone number entries: Mobile (604) 123-4567 iPhone (778) 123-4567 Home (604) 789-4561 Work (604) 456-7891 Main (604) 789-1234 megaphone (234) 567-8990 Note that the first five labels are default labels provided by the Contacts application and the last label, "megaphone", is a custom label. I wrote the following method to retrieve and display the labels

Is this the right way to delete a contact from the iPhone?

柔情痞子 提交于 2019-12-05 03:54:32
问题 I am trying to delete a contact from the iPhone which I have created. I tried to find a good working example of deleting a contact, however didn't find one. Adding a contact seemed quite easy but deleting one seems hard. The following code does not work, but it seemed to be plausible: ABAddressBookRef addressBook = ABAddressBookCreate(); ABRecordRef delete = ABPersonCreate(); ABRecordSetValue(delete, kABPersonFirstNameProperty, @"Max", nil); ABRecordSetValue(delete, kABPersonLastNameProperty,

Why would ABAddressbookRef need to be created for each thread?

邮差的信 提交于 2019-12-05 02:12:34
Apple says: Important: Instances of ABAddressBookRef can not be used by multiple threads. Each thread must make its own instance. But why? I know that some particular class or operations must be done in main thread. And I know some objects are not thread-safe (which means it would cause problem if these objects are accessed by two different threads concurrently). But, if you can make sure that the the thread-unsafe objects are accessed by only one thread at any moment, then there should be no problem. Do I understand correctly thus far? What I can't understand is, Why would some objects like

How to get an iPhone address book contact's emails as NSStrings?

别等时光非礼了梦想. 提交于 2019-12-04 23:43:21
问题 I know that there can be multiple values for an email, but I'm not sure how to browse through them. I can get a person correctly. ABRecordRef person = // getting a person; NSString* emails = (NSString *)ABRecordCopyValue(person, kABPersonEmailProperty); ... what's next? If I try to print the emails variable I get: Emails: <NSCFType: 0x4018d40> 回答1: It is because emails should not be a string, but an array. People can have many emails! ABMultiValueRef emails = ABRecordCopyValue(person,

iOS Getting selected contacts' email address in array

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 16:57:06
What I'm trying to do is show the people picker to the user, make him select all the contacts he wants, and finally get all those contacts' email addresses in an array. The best would be showing only contacts with email to the user. Until now the only thing I've been able to do is presenting the people picker with this code: ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; picker.peoplePickerDelegate = self; [self presentModalViewController:picker animated:YES]; Then I was trying to use this code to get the selected contacts' email: - (BOOL