Question

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.

Was it helpful?

Solution 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.

OTHER TIPS

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top