Question

I am using Spring Social, and its Facebook integration.

I am trying to fetch details of the current user's friends (such as Location, etc.), but the result is always empty. Now, I believe that this is because this is available only with "user_location" or "friends_location" extended permission.

I am wondering how can I authorize my application for those permissions of the user, and successfully fetch the details like friend's location?

Just to reiterate - this has to be done within my Spring Social project.

Thanks in advance!

Was it helpful?

Solution

You can authorize your application for those permissions of the user in the following way

    "redirect:https://graph.facebook.com/oauth/authorize?" +
     "scope=" + userPermissions + 
     "&client_id=" + clientId +
     "&display=page&redirect_uri=" + redirectURI;

Where userPermissions is what are the permissions you need, clientId is your facebook appId, and redirectURI is where you go after authorizing (this must be same as your app's site url).

You can also fetch your friend details successfully by

http://static.springsource.org/spring-social-facebook/docs/1.0.x/reference/html/apis.html#facebook-getProfile

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