Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to get the "Me" card from iPhone Address Book API?

Tags:

So I'm stumped on this one.

In Mac OS X there is an easy way to get the "Me" card (the owner of the Mac/account) from the built-in address book API.

Has anyone found a way to find out which contact (if it exists) belongs to the owner of the iPhone?

like image 647
amattn Avatar asked May 07 '09 18:05

amattn


People also ask

How do I get my card from Apple contacts?

Complete My CardTap My Card at the top of your contacts list, then tap Edit. Contacts suggests addresses and phone numbers to help you set up My Card. , then enter your information. Next, go to Settings > Contacts > My Info, then tap your name in the contacts list.

How do I access my address book on my Iphone?

Tap the Phone app to open it and tap the Contacts icon or launch the Contacts app from the home screen. Browse your contacts or enter a name in the search bar at the top of the screen.

What is my card for in contacts?

Each user's card is called My Card, and usually, it is created with just a little information about the user like first name, last name, and phone number. It's left for each user to edit and add more info to the card as they see fit. You can also share your contact card with other people via various platforms.

How do I add website contacts to my iphone?

In the upper right-hand corner of your screen, tap the + button to add a new contact. 3. Type the first and last name of the contact you wish to add, and fill in any relevant fields, such as their phone number, email address, mailing address, birthday, website URL, and more.


1 Answers

You could use the undocumented user default:

[[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"]; 

and then search the address book for the card with that phone number.

Keep in mind that since the User Default is undocumented, Apple could change at any time and you may have trouble getting into the App Store.

Another approach you could take, although it is much more fragile, is to look at the device name. If the user hasn't changed it from the default "User Name's iPhone" AND they are using their real name as an iPhone, you could grab the user name from that. Again, not the best solution by any means, but it does give you something else to try.

The generally accepted answer to this question is to file a Radar with Apple for this feature and to prompt users to choose their card.

like image 127
Martin Gordon Avatar answered Oct 10 '22 00:10

Martin Gordon