Saket
Saket

Reputation: 46137

Spring Social - Get extended permissions for Facebook friends

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!

Upvotes: 2

Views: 3179

Answers (1)

Rafiq
Rafiq

Reputation: 2000

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

Upvotes: 3

Related Questions