2

How can I access information from my Gmail account like photo, tokenId, first name, last name, and Gmail id?

I have searched a lot, but there is no proper answer.

DD_
  • 7,230
  • 11
  • 38
  • 59
NiravPatel
  • 3,260
  • 2
  • 21
  • 31
  • 2
    Take a look at [Google Data APIs](https://developers.google.com/gdata/). [Retrieving a contact's photo](https://developers.google.com/google-apps/contacts/v3/#retrieving_a_contacts_photo) – Parag Bafna Feb 25 '13 at 05:39
  • It is programming question my friend.I just want to authenticate user via his/her gmail account and once user succesfully login, user can see his/her profile picture. – NiravPatel Feb 25 '13 at 05:40
  • [The Google Data APIs Objective-C Client Library](http://code.google.com/p/gdata-objectivec-client/) – Parag Bafna Feb 25 '13 at 05:41
  • Unfortunately i have not found any good code for that.I am stuck there my friend.Can you help me please? – NiravPatel Feb 25 '13 at 05:41
  • @ParagBafna :i have checked that api my friend.But i cant find any method there to retrieve basic information of user. – NiravPatel Feb 25 '13 at 05:43

1 Answers1

0

This api https://www.googleapis.com/plus/v1/people/me returns

{
 "gender": "male",
 "id": "234343028403284",
 "displayName": "xxx",
 "name": {
    "familyName": "foo",
    "givenName": "bar"
   },
 "url": "https://plus.google.com/34324234324324",
 "image": {
  "url": "https://lh3.googleusercontent.com/dlkfjdsfds/djfldsf"
   }
 ...
 }

Before your application can get access to data from a user's Google Account, the application must request authorization from the user.

See https://developers.google.com/+/api/oauth for information about oauth.

try: https://developers.google.com/oauthplayground/ will help you understand oauth flow:

freestyler
  • 5,224
  • 2
  • 32
  • 39