0

I try to get my birthday date using deprecated Plus.API. I request scopes: Plus.SCOPE_PLUS_PROFILE, Plus.SCOPE_PLUS_LOGIN and Scope("https://www.googleapis.com/auth/user.birthday.read").

I even got dialog from Google Plus, that app request full birtday date. But wth I got response with null birthady even if it is pblic on mu G+ page?

Code:

public static final Scope SCOPE_PLUS_BIRTHDAY = new Scope("https://www.googleapis.com/auth/user.birthday.read");

    GoogleSignInOptions gso = new GoogleSignInOptions
            .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestEmail()
            .requestId()
            .requestProfile()
            .requestScopes(SCOPE_PLUS_BIRTHDAY, Plus.SCOPE_PLUS_PROFILE, Plus.SCOPE_PLUS_LOGIN)
            .build();

    mGoogleApiClient = new GoogleApiClient.Builder(mActivity)
            .enableAutoManage(mActivity, this)
            .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
            .addApi(Plus.API)
            .build();

Response:

[{value='antoxa2584@gmail.com', key='email', parentId=null}, {value='Антон Артемов', key='name', parentId=null}, {value='https://plus.google.com/100328752299073028996', key='url', parentId=null}, {value='https://lh4.googleusercontent.com/-WNQOIPjFjtY/AAAAAAAAAAI/AAAAAAAAP7E/LjtF7njMedE/photo.jpg?sz=50', key='photo_url', parentId=null}, {value='0', key='age_range_max', parentId=null}, {value='21', key='age_range_min', parentId=null}, {value='null', key='about_me', parentId=null}, {value='null', key='birthday', parentId=null}, {value='null', key='location', parentId=null}, {value='male', key='gender', parentId=null}, {value='ru', key='language', parentId=null}, {value='null', key='nick_name', parentId=null}, {value='0', key='relat_status', parentId=null}]
Anton A.
  • 1,718
  • 15
  • 37
  • is that even a valid scope where did you find that? – Linda Lawton - DaImTo Sep 13 '16 at 10:36
  • @DaImTo, yes Plus.SCOPE_PLUS_PROFILE, Plus.SCOPE_PLUS_LOGIN default in Plus. SCOPE_PLUS_BIRTHDAY I found on some git – Anton A. Sep 13 '16 at 10:39
  • I have never seen it before and I have googled it I cant find any refrence for it https://developers.google.com/+/web/api/rest/oauth unless you can find some way to prove it exists and its not something you are just trying to send this is probably a duplicate of another question. Happy to remove it if someone can show its an android only issue. – Linda Lawton - DaImTo Sep 13 '16 at 10:41
  • 2
    Possible duplicate of [how to specify the scope of google api to get the birthday](http://stackoverflow.com/questions/23896424/how-to-specify-the-scope-of-google-api-to-get-the-birthday) – Linda Lawton - DaImTo Sep 13 '16 at 10:41
  • @DaImTo, nope, that does not work – Anton A. Sep 13 '16 at 13:56

1 Answers1

0

You cannot retrieve the birthday without setting it to public. I don't believe the user's birth year is returned either. You can use the age range for verifying a user's age and can use their birthday (if they make it public) for social engagement on their birthday.

Try using the API Explorer to test this after setting your profile to public.

class
  • 8,621
  • 29
  • 30