Requesting data about user iOS - ios

Is there an API in iOS which would allow me to discover information about the user who owns the phone?
The address book api would allow me access to their contacts, but how would I find out about the self user?
Thanks!

You could go through all the contacts in the Address Book and see if any of them are marked with the owner flag.
Edit
This was removed a while back, another way is getting the device name
UIDevice.currentDevice().name
"Bob's Iphone"
Then you could cylce through the address book and find a bob, this is a solution i wouldn't recommend, the best bet might be to ask the user for their details

Well there's not much more you can get from a user due to them wanting their privacy but there are a couple of things you can still find out about a user:
Get Device Info (find out more about their device)
HealthKit API (Get users health data like how many steps they make what they eat and drink etc)
Photo Album Access (access to their photos and videos)
That's about it really! Hope it helps :)

Related

Is there a way to extract user’s full name from HealthKit in Swift?

I am trying to build a fitness app and I would like to build the user’s profile within the app but I would like to make it as quick and easy as possible for the user. I am able to extract the users stats such as height, body mass, birth date etc from HealthKit but is there a way for me to extract the user’s full name since the ios health app has this on it’s profile page.
I have sifted through the documentation, but so far I haven’t found anything.
no there is no api AFAIC.
you can ask for addressbook access and read the 'me' contact
Well you could go through all the contacts in the AddressBook and see if any of them are marked with the owner flag.
Just be aware that doing this will popup the "this app wants access to the address book" message. Also Apple isn't very keen on these kind of things. In the app review guide it is specified that an app can not use personal information without the user's permission.
You will get the username like this:
var username = NSUserName()!
and you can use same user name for your app.
Yeah, I don’t want to meddle with the address book and freak the user out. I’ll probably just ask them to enter their name instead.

iOS : Get favorite contacts list in Contacts Framework [duplicate]

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.
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 asking you.
Filip is correct, you cannot access the list of favorite contacts on iOS via a public, app-store legal API.
To come close you could try to guess a user's favorite or most important contacts from their address book. Let's assume that people know most about the people they are closest to and that this is also reflected by their phone's address book:
For example, the address book contact for a close friend contains more
information (address, birthday, maybe a nickname) than a contact for a
business associate or a colleague at work.
We could then use this information to compute an importance score for each address book contact. By taking the n most important contacts we could approximate a user's favorite contacts.
I've written about this idea some more on my blog: http://dbader.org/blog/guessing-favorite-contacts-ios You can also find a sample implementation and a demo application there.
I have searched through the API and could not find any appropriate methods. Maybe Apple believes that this is a Phone-app data field or maybe it is about security. I'd love to use it, too.

Fetch Google plus news feed in native ios

i am working on ios app, and i want to fetch Google Plus news feed like friend list, user detail, in my ios app.
in facebook its possible to fetch the active user's profile feed, but for google pluse i didnot found any thing to show user feed.
if any one know how to do this for iphone application then please help me.
thanks in advance.
After you have signed in a user with Google, you can access the user's age range, language, public profile information, and people that they have circled.
If you request the plus.profile.emails.read scope, you can also get their email address. With this rich social data, you can build engaging experiences and an instant community in your app.
For example, you might connect your user with their friends that also use your app or you might make suggestions based on their friends' activities within your app.
Please look at Getting people and profile information

Find Favorite contacts from the iOS Address Book API

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.
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 asking you.
Filip is correct, you cannot access the list of favorite contacts on iOS via a public, app-store legal API.
To come close you could try to guess a user's favorite or most important contacts from their address book. Let's assume that people know most about the people they are closest to and that this is also reflected by their phone's address book:
For example, the address book contact for a close friend contains more
information (address, birthday, maybe a nickname) than a contact for a
business associate or a colleague at work.
We could then use this information to compute an importance score for each address book contact. By taking the n most important contacts we could approximate a user's favorite contacts.
I've written about this idea some more on my blog: http://dbader.org/blog/guessing-favorite-contacts-ios You can also find a sample implementation and a demo application there.
I have searched through the API and could not find any appropriate methods. Maybe Apple believes that this is a Phone-app data field or maybe it is about security. I'd love to use it, too.

Track location of friends

I would like to make it possible for the user to track their friends through one of my applications. The application is for a music festival.
I have been thinking of ways to do this:
Let the user set a nickname for the device (associated with the UDID) and let users add each other to a "friend list" by their nickname. When the application is running the location of the users would be sent around through push messages. This might be a bit hard to integrate - and I kind of hate working with push notifications.
Set up accounts for each user then store the user's most recent location in a database and read them. Again, users will add each other by nicknames. This would be a really easy solution but I am not sure if it is legal to store the location of the user (maybe I could ask them for permission and not have this option enabled by default?)
I have seen an application doing this "friend tracking" and doing it by having the user log into Facebook. I did not try this feature and I do not know how they do it with Facebook. Maybe you do?
Any thoughts on these solutions or are there any other ways to accomplish this?
Have you seen google latitude?
http://nexos.ravex.net.au/apps/xnetViewer/?q=google+latitude
Has api
http://code.google.com/apis/latitude/

Resources