addressbook

Get image contact in address book on iOS

爱⌒轻易说出口 提交于 2019-12-05 14:54:04
问题 I'm new using the Address book and I would try to get some info for the contacts in the phone. Is possible get the image contact of all the contacts? This will be for iOS4 or higher. Thanks in advance! 回答1: Yes it is completely possible, you simply ask each person record whether it has an image: See the documentation: http://developer.apple.com/library/ios/#documentation/AddressBook/Reference/ABPersonRef_iPhoneOS/Reference/reference.html#//apple_ref/doc/uid/TP40007210 Relevant Functions:

iOS7 - ABPersonViewController, editing mode

孤人 提交于 2019-12-05 13:32:24
问题 Apple features a nice comprehensive and small example, "QuickContacts" (developer.apple.com/library/IOs/samplecode/QuickContacts/Introduction/Intro.html), outlining the basic usage of the Address Book UI Framework. - The downloadable sourcecode works as described (once you add a person named "Appleseed" to your addressbook or change the person-name in line 246 (of QuickContactsViewController.m) to something that already exists in your addressbook). Question: How can we modify the function -

unable to create a person using VCard representation

不问归期 提交于 2019-12-05 05:17:10
问题 I am developing an app using XCode 4.2 and I am trying to create an ABPerson using initWithVCardRepresentation and/or ABPersonCreatePeopleInSourceWithVCardRepresentation , but I can t find a working example . can someone help? I get the VCard in an NSString format.... Thanks 回答1: This is a full example and it works perfectly, it bases on the latest iOS 8. First of all you should check authorization status and request access right if not, then save the vcard, let just review the code below: if

Accessing native iPhone addressbook database and performing add and delete contacts?

眉间皱痕 提交于 2019-12-04 21:31:29
In my application I need to implement the address book which should contains the native addressbook details, and the user should be able to add and delete from the address book and it should be updated in the native iphone addressbook. I read somewhere that the iphone native address book database is accesible. In documentation also I saw that addContact and Delete API's are exposed to addressbook. Can anyone please tell me how can I access the native AddressBook of the iphone, and.. how to add and delete contacts from the address book? Can anyone post the sample code for this? You need to use

Add Contact to Existing Group programatically in iphone

自闭症网瘾萝莉.ら 提交于 2019-12-04 19:21:37
I want to add ABRecordRef to existing Group. Some how its not working. Here is my code: -(void)addUsers:(NSMutableArray*)users toGroupID:(ABRecordID)groupID { CFErrorRef error = NULL; ABAddressBookRef addressBookRef = ABAddressBookCreate(); // Get Group ABRecordRef group = ABAddressBookGetGroupWithRecordID(addressBookRef,groupID); for (User *user in users) { int recordId = user.uniqID; ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressBookRef,(ABRecordID)recordId); //add the new person to the record ABAddressBookAddRecord(addressBookRef, person, nil); ABAddressBookSave

Add phone number to existing contact

为君一笑 提交于 2019-12-04 17:14:26
I am trying to add a phone number to an existing contact using the AddressBook framework, after selecting a person with the picker this method is called: - (BOOL) peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { if(_phoneNumber != nil) { ABMutableMultiValueRef multiPhone = ABMultiValueCreateMutableCopy (ABRecordCopyValue(person, kABPersonPhoneProperty)); ABMultiValueAddValueAndLabel(multiPhone, (__bridge CFTypeRef)_phoneNumber, kABPersonPhoneOtherFAXLabel, NULL); ABRecordSetValue(person,

how to check whether organization name is added before saving contact in address book?

百般思念 提交于 2019-12-04 17:09:45
I am working on a AddressBook project, One of my requirement is While adding new Contacts manually using my application it should check whether "Organization field" value is entered by user/not. I have Add(+) button on my Navigation Bar with d following code snippet: UIBarButtonItem *addButton = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(add:)]; self.navigationItem.rightBarButtonItem = addButton; A present modal view appears on clicking this add button, by native Address Book; -(void)add:(id)sender { ABNewPersonViewController *view

Get Email address from iPhone Address Book

我的未来我决定 提交于 2019-12-04 17:02:09
I am currently able to successfully access and get data from the peoplePickerNavigationController , but what I would like to do is have the email address of the contact be accessed, then the modal window dismissed when the contact name is pressed. Scenario: "Button is clicked to add a contact AddressBook Modal Window slides into view Name of Contact is pressed If available, the contact's email address is stored in an array Dismiss modal window" My current code consists of: - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker

Can't Access Contacts Sources on Device in iOS 6

大城市里の小女人 提交于 2019-12-04 16:43:20
问题 This code worked OK on iOS 5.1 and also does work in the iPhone simulator with iOS 6. It fails silently on my iPhone 4 running iOS 6. The end result is that I cannot add a person to the Contacts app. Neither of the following code snippets work (log follows each): ABRecordRef defaultSource = ABAddressBookCopyDefaultSource(_addressBook); NSLog(@"2 - defaultSource = %@", defaultSource); AB: Could not compile statement for query (ABCCopyArrayOfAllInstancesOfClassInSourceMatchingProperties):

iPhone: How do you get the names of all the address books on the iPhone?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 15:47:48
Some users have multiple address books in their iPhone Contacts, as a result of different synchronization connections they have made with e.g. Exchange Servers. How is it possible to get all of these different address books? I would be interested in getting the names under which these different address books are saved and accessing their contact information. Thank you! ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef sourcesArray = ABAddressBookCopyArrayOfAllSources(addressBook); for (CFIndex i = 0; i < CFArrayGetCount(sourcesArray); i++) { ABRecordRef source = (ABRecordRef