Google People API can't get birthday

This is my first stackoverflow question. I have a problem with the Google People API when I try to get the user's birthday. Here is the log from my logcat.

D/FitPartners: {"date":{"day":20,"month":1},"metadata":{"primary":true,"source":{"id":"1....41","type":"PROFILE"}}}

As you can see, I can get a month and a day just fine. But there is no year. Even when I use Google Try! from https://developers.google.com/people/api/rest/v1/people/get . The answer does not give a year.

 Response 200 OK - Show headers - { "resourceName": "people/1.......41", "etag": "r....a4o=", "birthdays": [ { "metadata": { "primary": true, "source": { "type": "PROFILE", "id": "1........41" } }, "date": { "month": 1, "day": 20 } } ] } 

I tried to figure this out and do a search from stackoverflow 4 days before making a decision. Please, help.

+5
source share
1 answer

If you want to check a person’s age, maybe see if the https://www.googleapis.com/auth/profile.agerange.read field matches the field.

0
source

Source: https://habr.com/ru/post/1257573/


All Articles