abaddressbooksource

How can i delete contact from main AddressBook when i delete specific group in objective-c?

浪尽此生 提交于 2020-01-04 06:26:36
问题 i want to delete the group on addressBook. i have try this code it is successfully delete the group but on main addressBook contact are not deleted. CFErrorRef error = NULL; ABAddressBookRef iPhoneAddressBook = ABAddressBookCreate(); ABRecordRef newGroup; newGroup = ABAddressBookGetGroupWithRecordID(iPhoneAddressBook,groupId); ABAddressBookRemoveRecord(iPhoneAddressBook, newGroup, &error); ABAddressBookSave(iPhoneAddressBook,&error); my requirement is i have one service to call every time

How can i delete contact from main AddressBook when i delete specific group in objective-c?

拜拜、爱过 提交于 2020-01-04 06:26:30
问题 i want to delete the group on addressBook. i have try this code it is successfully delete the group but on main addressBook contact are not deleted. CFErrorRef error = NULL; ABAddressBookRef iPhoneAddressBook = ABAddressBookCreate(); ABRecordRef newGroup; newGroup = ABAddressBookGetGroupWithRecordID(iPhoneAddressBook,groupId); ABAddressBookRemoveRecord(iPhoneAddressBook, newGroup, &error); ABAddressBookSave(iPhoneAddressBook,&error); my requirement is i have one service to call every time

How to modify a contact number in address book programmatically?

不问归期 提交于 2019-12-24 10:59:41
问题 I am currently writing an app which should enable the user to modify the contact details (mainly numbers) in the app, and then these modifications should be reflected directly to the Address Book. I searched thoroughly on the internet, but all the examples I found were either to load the contacts or add new contact, but nothing on modifying an existing contact. also how can I get a list of all phone numbers of a single contact, in case he has several numbers stored. 回答1: To allow a user to

Check if ABMultiValueRef is has no values

不问归期 提交于 2019-12-13 19:38:40
问题 I want to check if a contact in my user's addressbook a phone number has. If he does, I want to display that name in an UITableView I've tried to check for phoneNumbers != nil , but that doesn't work. This is my entire code: ABMultiValueRef phoneNumbers = ABRecordCopyValue(person, kABPersonPhoneProperty); if(phoneNumbers != nil){ [_numbers addObject:[NSString stringWithFormat:@"%@", phoneNumbers]]; } 回答1: Use ABMultiValueGetCount to check if phoneNumbers has any values in it. example based on

Address Book iOS : Contact name from string

只愿长相守 提交于 2019-12-12 00:47:48
问题 I am trying to automatically add contact to the iOS address book from my app, where the name of the contact is from a NSString. I have tried to figure it out (see code under), but It didn't work. It works to add contacts with the first code I have provided (I have the save code and stuff), but I would like to add contact from string that may vary, not just a name that can't. ABRecordRef newPerson = ABPersonCreate(); ABRecordSetValue(newPerson, kABPersonFirstNameProperty,@"Davis11", &error);

Read name of ABSource

99封情书 提交于 2019-12-11 06:13:45
问题 I want to read the name of an ABSource in the addressBook framework. Is this possible? The following code sample leaves me with null, while the currentSource pointer is valid. NSString* stringName = (NSString*)ABRecordCopyValue(currentSource, kABSourceNameProperty); Thank you in advance, Martin 回答1: NSString *sourceTypeName = (NSString *)((CFStringRef)ABRecordCopyValue(source, kABSourceNameProperty)); ABSourceType sourceType = [(NSNumber *)ABRecordCopyValue(currentSource,

iOS - How to search a “searchable” ABSource, with ABSourceType | kABSourceTypeSearchableMask

烂漫一生 提交于 2019-12-03 16:23:30
问题 Has anyone ever succeeded in searching for names in an Exchange GAL linked to an iOS device, using ABAddressBook framework, or otherwise? I've managed to get all the names from the contacts stored on the device - that bit's easy - but it doesn't include names from the Exchange GAL. I've also managed to get the ABSource for the GAL. It's type is: kABSourceTypeExchangeGAL = kABSourceTypeExchange | kABSourceTypeSearchableMask This suggests the source is searchable, given that the

iOS - How to search a “searchable” ABSource, with ABSourceType | kABSourceTypeSearchableMask

自作多情 提交于 2019-12-03 05:50:30
Has anyone ever succeeded in searching for names in an Exchange GAL linked to an iOS device, using ABAddressBook framework, or otherwise? I've managed to get all the names from the contacts stored on the device - that bit's easy - but it doesn't include names from the Exchange GAL. I've also managed to get the ABSource for the GAL. It's type is: kABSourceTypeExchangeGAL = kABSourceTypeExchange | kABSourceTypeSearchableMask This suggests the source is searchable, given that the kABSourceTypeSearchableMask bit is set ( kABSourceTypeSearchableMask = 0x01000000 ), but how to search it is anyone's