addressbook

how to get around lack of 'add' button in ABPeoplePickerNavigationController?

与世无争的帅哥 提交于 2019-12-04 13:05:46
My app needs to associate instances of a custom class with contact records in the iPhone's AddressBook. Everything's all well and good when I present the ABPeoplePickerNavigationController and allow the user to pick an existing contact. Problem is there's no obvious way to allow a user to easily ADD a contact record if the one they're looking for doesn't already exist in their AddressBook. How are people getting from ABPeoplePickerNavigationController to ABNewPersonViewController in a way that's easy & intuitive for the user? You can create a UIBarButton and add it to the UINavigationBar of

iOS can't get person's image

此生再无相见时 提交于 2019-12-04 11:36:04
I have two tableViewControllers. The first one has a list of contacts. The another one shows detailed person's information. A chunk of code of first tableViewController ABAddressBookRef addressBook = ABAddressBookCreate(); ABRecordRef source = ABAddressBookCopyDefaultSource(addressBook); NSArray *allPeople = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(addressBook, source,kABPersonSortByFirstName); for ( int i = 0; i < [allPeople count]; i++ ) { ... contactClass = [[ContactClass alloc] initWithName:name surName:surName manID:[allPeople objectAtIndex:i]]

How to create vCard/vcf file to use in share sheet?

半世苍凉 提交于 2019-12-04 08:34:43
问题 I'm new to swift and methods I am finding are deprecated regarding my issue. I'm building a directory app and I'm pulling contact data from an API, not from the phone's address book. In iOS, if you go to your address book, you can select a contact and choose 'Share Contact' which brings up a share sheet. I want this exact functionality in my app. I think I've got Share Sheets figured out, and here's my code for that: @IBAction func actShare(sender: AnyObject) { let activityViewController =

ABAddressBookRegisterExternalChangeCallback works, but data is stale

六月ゝ 毕业季﹏ 提交于 2019-12-04 04:39:21
My app registers the callback once: notificationAddressBook = ABAddressBookCreate(); ABAddressBookRegisterExternalChangeCallback(notificationAddressBook, MyAddressBookExternalChangeCallback, self); Then in my callback: void MyAddressBookExternalChangeCallback (ABAddressBookRef notifyAddressBook,CFDictionaryRef info,void *context) { NSLog(@"in MyAddressBook External Change Callback"); ABAddressBookRevert(notifyAddressBook); CFArrayRef peopleRefs = ABAddressBookCopyArrayOfAllPeopleInSource(notifyAddressBook, kABSourceTypeLocal); CFIndex count = CFArrayGetCount(peopleRefs); NSMutableArray* people

Is it possible to access the iPhone “Favorite” numbers?

本小妞迷上赌 提交于 2019-12-04 02:27:32
问题 I want to access the iPhone "Favorites" numbers (the ones that can be found in the "Phone" application). I've searched among the properties specific to each contact from the Address Book and I even had a look at the Address Book database, but I couldn't identify which property or field from the database indicates which are the favorite numbers. Since "Phone" is an application installed by Apple on the iPhone I was expecting to find such a property in the database. However, I think that it

iOS7 - ABPersonViewController, editing mode

血红的双手。 提交于 2019-12-04 01:53:42
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 -(void)showPersonViewController function in such a way that the ABPersonViewController "picker" is

unable to create a person using VCard representation

不打扰是莪最后的温柔 提交于 2019-12-03 21:22:40
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 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 (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized){ NSLog(@"Authorized"); [self

Get image of a person from iPhone address book

末鹿安然 提交于 2019-12-03 20:39:20
问题 How do you get a person's image from an iPhone address book? 回答1: You can do it like this.... NSData *imgData = (NSData *)ABPersonCopyImageData(person); UIImage *img = [UIImage imageWithData:imgData]; where person is of type ABRecordRef . Now, as CFData and NSData are toll-free bridged, you can simply type cast CFData to NSData and get the image Hope this helps. 回答2: (NSData*)ABPersonCopyImageDataWithFormat([targetPeople objectAtIndex:index], kABPersonImageFormatThumbnail) This is faster

Getting merged/unified entries from ABAddressBook

老子叫甜甜 提交于 2019-12-03 18:30:19
问题 I'm developing an application that is showing the iPhone contacts. The ABAddressBookRef returns duplicate entries for a contact that appears only once in the iPhone contacts application. Looking on the contact card (from the iPhone contacts), in the bottom there is a section called "Linked Contacts" so obviously apple "merge"/"unify" these two entries into the one i see. The question here is what is the best way to mimic the same behavior so my app will show only one entry? is there an API

How to select a contact with ABPeoplePickerNavigationController in Swift?

霸气de小男生 提交于 2019-12-03 11:23:13
问题 I have added the ABPeoplePickerNavigationController into my first view controller. I want that when I select a contact show the info to show in other view controller, but I'm trying use my code and this not show never when I click in a contact. This only open the contact into native app ABPeoplePickerNavigationController . var people = ABPeoplePickerNavigationController() var addressBook: ABAddressBookRef? func extractABAddressBookRef(abRef: Unmanaged<ABAddressBookRef>!) -> ABAddressBookRef?