문제

I'm trying to retrieve the public profile information from facebook using Spring Social. I was able to retrieve everything except for age_range.

Please suggest me some possibilities where I could retrieve the age range info.

Note: I don't want to retrieve any extended profile info. I just want the public profile.

도움이 되었습니까?

해결책 2

Using Rest Operations solved the problem.

FacebookProfile profile = fb.restOperations().getForObject("https://graph.facebook.com/me?fields=age_range", FacebookProfile.class); Age_range can be obtained by using profile.getExtraData which is in Map format.

다른 팁

The age_range is not really a valueable info, it only contains the differentiations 13-17, 18-20 or 21+. I guess Spring Social is not supporting this field currently.

The page https://developers.facebook.com/docs/facebook-login/permissions/ is stating

Use any available public profile information before asking for a permission. For example, there is an age_range field included in the public profile for anyone who installs your app. This field may be sufficient for your app instead of requesting user_birthday permission.

As far as I understood you're using an app already?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top