addressbook

How to tell ABPeoplePickerNavigationController to list only contacts that have an email address?

我的未来我决定 提交于 2019-12-19 19:15:24
问题 I want my users to fill an email field by selecting a contact's email from their address books. I don't want them to scroll all the contacts whose emails are not set, so I want to filter the ones that have email addresses. This is the code I've written so far. I can figure out who has an email address and who has not but I couldn't tell the ABPeoplePickerNavigationController to list only the right contacts. Is it impossible to achieve this, I mean do I have to implement my own contact picker

What ABRecordCopyValue can return? (solving a bad access)

戏子无情 提交于 2019-12-19 04:07:07
问题 I'm using this simple code to get all contacts of the address book in ios 7. I have 155 contacts in my address. When i log people firstNames i obtain 34 correct names picked (apparently randomly) from my address book, 15 names null and then on item 50 a bad access crash on line NSString *firstNames = (__bridge NSString*)ABRecordCopyValue(person, kABPersonFirstNameProperty) I tried loggin surname, or image getting no changes. I tried to avoid doing ABRecordCopyValue on null object getting no

How to know which specific contact was updated in android?

Deadly 提交于 2019-12-19 03:25:23
问题 I am able to get a generic notification "that there was a change to the contacts DB", but I want to know the specific record that was inserted, updated, or deleted. I don't want to use Look-up URI concept because I don't want to set look-up URI for every contact individually. I want a generic solution that I can know when any contact is updated or deleted. 回答1: You can implement an Service to watch the database status. import android.app.Service; import android.content.Intent; import android

How to get street address from ABPeoplePickerNavigationController

谁都会走 提交于 2019-12-18 17:30:45
问题 I need a contact's street address. I know how to get the single value properties, but the street address is a multivalue property. Apple's documentation shows how to set it, but not retrieve it. Any help? PS: this does not work: ABRecordCopyValue(person, kABPersonAddressStreetKey); 回答1: I just figured it out: ABMultiValueRef st = ABRecordCopyValue(person, kABPersonAddressProperty); if (ABMultiValueGetCount(st) > 0) { CFDictionaryRef dict = ABMultiValueCopyValueAtIndex(st, 0); self.street.text

How to correctly use ABPersonViewController with ABPeoplePickerNavigationController to view Contact information?

安稳与你 提交于 2019-12-18 10:53:20
问题 Update 9/2/10: This code no longer works as of the iOS 4 update--it fails with an internal assertion. There is now a great Address Book API example available in the iPhone SDK Reference Library called "QuickContacts." The example code is available here; it will help you solve this problem: http://developer.apple.com/iphone/library/samplecode/QuickContacts/Introduction/Intro.html I'm attempting to add a feature to my app that allows the user to select a contact from an

Address Book constants evaluating as zero

前提是你 提交于 2019-12-18 08:39:33
问题 I have a program where for certain code paths, the address book constants (such as kABPersonEmailProperty, kABPersonAddressProperty) evaluate to their normal non-zero value. However, if I follow a different code path, all these constants evaluate to zero. Furthermore, once I follow the "successful" code path, if I take the problematic code path it works. Is this some kind of compile linkage issue ? I could also be over-releasing a variable somewhere. 回答1: Okay, mystery solved. To Apple's

How to get formatted address NSString from AddressDictionary?

本秂侑毒 提交于 2019-12-18 04:34:07
问题 Trying to get formatted address from AddressDictionary, that I got from CLGeocoder. Used following code with no result: subtitle = [NSString stringWithString:[[addressDict objectForKey:@"FormattedAddressLines"]objectAtIndex:0]]; Also tried: subtitle = [[[ABAddressBook sharedAddressBook] formattedAddressFromDictionary:placemark.addressDictionary] string]; but this code seems working on Mac OS X only. Compiler asks about ABAdressBook, but I have both header files imported. #import <AddressBook

Is the newly added 'My Card' that automatically shows up in IOS9 a reliable way to get a users phone number?

不羁的心 提交于 2019-12-17 21:17:57
问题 Am I correct that with a address book permission we should be able to pretty reliably get a users phone number if they have given address book permissions via the new "My Card" contact that seems to be automatically added to your addressbook when you download IOS9? I always wanted to do a find friends but i did not want to force users to type/verify their number....this seems to be a solid work around for ios9 users. 回答1: I am currently dealing with the same issue but unfortunately it seems

Find Favorite contacts from the iOS Address Book API

只谈情不闲聊 提交于 2019-12-17 19:38:32
问题 Is there a way to find Favorite contacts from the iOS Address Book API? I'm referring to the contacts a user places in his Favorites tab in the Contacts app. 回答1: Favorites are stored inside Phone.app, not inside the Address Book database itself. You can't access other app's sandbox on a non-jailbroken iPhone, so unfortunately the answer is no. Also, it would be pretty bad for privacy if any app could see your favorite contacts. It's already bad that it can access entire address book without

How can I set a ringtone for an individual contact on Android?

纵然是瞬间 提交于 2019-12-17 15:52:19
问题 How can I apply a ringtone to only the selected contact? I have found a way to set the default ringtone that applies to all contacts, but that is not my goal. I want an application to have a button ("Apply ringtone to contact") that, when clicked, starts an activityForResult displaying a list of all contacts on the phone. When a contact is selected, the contact activity closes and returns with a URI to the contact. Then the app needs to apply the selected ringtone to that specific contact.