Detecting the iPhone User’s Name

There have been a lot of questions about how to detect the name of the user on the iPhone. I thought I would take some time today to walk everyone through the process.

One of the challenges a lot of developers have been facing is that there is no -(ABPerson *)me method on the iPhone. On a mobile device it is especially helpful to know who is using the device.

Initially looking at the challenge I spent a couple of days digging around the iPhone to see if it had any record of a “Me” address. I spent a lot of time in Mac’s AddressBook application using Changes to see if the cards were somehow tagged with a “Me” reference that could later be read on the iPhone. Sadly this was a no-go. The iPhone strips all this information out of the contacts before syncing them to the device.

I have been asked to remove this entry from my blog. Sorry.

For my friends at Apple rdar://problem/6579406

Special thanks to Daniel Jalkut for turning me onto MarsEdit this is my first post using it.

One Response to “Detecting the iPhone User’s Name”

  1. Rob says:

    How about just using [[UIDevice currentDevice] name]? By default it returns something like “John Smith’s iPod”

Leave a Reply