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

1

5

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 through all of their contacts and select themselves.

Nitrobacteria answered 4/9, 2010 at 15:57 Comment(0)
S
6

There is no access to the users address book card. The reason is that Apple don't want apps to have the ability to see potentially personal information without the user first giving the app access to that information.

I, for one, would not want an app to be able to read my email address, phone number, and home address from my card and do what it pleases with it unless I said it could in the first place.

For that reason, you will have to present the user with the address book picker and allow them to select their address book entry.

Setose answered 4/9, 2010 at 23:58 Comment(1)
That's such a step backwards in usability though. Ideally there would be a special request that the app could make and the phone would ask the user if they want to grant the app permission to access their personal information. There's nothing like that you are aware of huh?Rhodos

© 2022 - 2024 — McMap. All rights reserved.