Is it possible to get the current user's address book record? - iphone

Assuming the user has granted permission for the app to access contacts, is there any way to determine which record belongs to the phone owner? For example if you browse the list of contacts on your phone, you will see a little "me" beside the record that is identified as the owner's record. So the phone clearly knows this, but is there any programmatic way to determine this? Or is that considered a privacy violation?

I know on a Mac you can use [[ABAddressBook sharedAddressBook] me]. For iOS, take a look at how Square's CardCase app does it.

Related

Flutter: How to get the users address from contacts

I've guessed the Users Address from their GPS, looking up their location using Google's Places, but the output of that is pretty variable (no locality oftentimes, outside cities a consistent locality field would be helpful to my app). The thing is I do NEED the users home address for my app to work, but they may not be at home when they download the app.
I'd prefer to get their address from contacts. I've looked at a couple of Flutter plugins for accessing the address book, flutter_contacts, etc., but I can't see how you simply get the users details. So how do I request the Users HOME address, HOME email, MOBILE phone, whatever I can get from the device? Age might actually be beneficial too, so I could pivot the app to the needs of those who are using it.
I feel this is such a commonly useful thing it should have its own special permission, rather than the blunt one of exposing their entire contacts address book. So is there a better way of doing it? Less invasive so the user can more easily consent?
There's a special contact called "Profile" that contains the user's details if they bothered to add them on their phones, but in most cases it'll be empty, and anyway, accessing the user's profile requires the "Read Contacts" permission.
It'll be strange to ask the user for the "Read contacts" permission without they understanding why on earth would your app require such a permission "to guess your address" is not a very good reason.
And I suppose might cause some users to uninstall and/or flag your app as potential spyware.
If you app relies on having the user's address, you should instead simply pop a dialog with a question to the user to fill out their address manually.

is there an API call that gives you an iPhone user's "My Info" contact DB record?

So in the latest iOS (not sure about prior) there is a "My Info" setting that let's the user pick a ContactDB record on his device that is "his".
Is there an API call to get this value? I can query the user's entire ContactDB, but figuring out which contact DB is his isn't trivial.
There’s no public API that I know of to retrieve the user’s “me” card. Your best option is probably to present an ABPeoplePickerNavigationController asking the user to select it.
Also, I believe Bump had a setup step that asked for your contact info, and the moment you gave it your phone number (or email?) it looked up the contact card with the matching info and autofilled the rest of the form. A bit of a workaround, but it did the trick.

iOS identify user(s)

I am building app that will serve some content to the users via my private server. At the server-side I would like to identify user, so that I don't serve same content twice to the same user. How can I identify user(s)?
One way is DeviceID, but user can have multiple devices...?
Is the only way to have my own user IDs for my application (registration). I don't like this as it adds extra complexity to the app.
I know it's a hard task, but maybe facial recognition (from the webcam) could help in logging in users, since it doesn't imply any relation between user and device.
For example, face.com offers a free web-based API for facial recognition.
Although, Ishu's answer (username/password) is the easiest and most standard way to do identify users.
Make an id for user's and also a login page in the app. save his id with in you content table for send that content for that user. if that content entry already having his id then don't send to him otherwise send to him.
I don't think there is another option. You must use user id nothing else.

display email inbox?

is there an option that I could retrieve from my app the latest 10 email subjects from my ipad email inbox.
I would like to display the user his last 10 subjects in my new app.
Any Ideas if this is possible and how?
best
chris
No, it's not. Apple doesn't allow access to most user data that's handled by the built-in native software, and even then generally not without the user explicitly giving the app access (such as in an address book picker).

Retrieving the Apple Id (or some kind of account id) in Objective C

I am writing a paid app for the store which gives you a 1 year subscription to some content.
This means I need to store on my web service db, when the user first launches the application some kind of unique user id (Apple ID?), along with the date. I can then do validation to check if the subscription is still valid.
I can see how to get a UDID but that's not really very good if they want to install it on another device with their existing iTunes account.
I would rather not make the user have to enter in an identifier themselves.
Keep in mind that the user may very easily change the apple id he or she is using on the device. He may even allow others (familiy members...) to use the same apple id. I wouldn't share mine, but there is no technical barrier for others to do so.
I can easily imagine apple not approving an app making such use of the users apple id, for this and a number of other reasons.
Having said this, I know of no way to retrieve it anyway.
Either tie the subscription to the UDID (and allow the user to migrate it later) or create some sort of accounts the users may log in to. I don't see a way around this...