简体   繁体   中英

No permission to access invitable friends

I am developing an android game app and want to get a list of Facebook invitable friends.

Unfortunately I hit this error: Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 100, errorType: OAuthException, errorMessage: (#100) No permission to access invitable_friends.} with code below.

Code

new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/me/invitable_friends",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback()
    {
         @Override
         public void onCompleted(GraphResponse response)
         {
             System.out.println(response);
         }
     }
).executeAsync();

Permissions

List< String> permissionNeeds = Arrays.asList("user_friends");

Can anyone helps me to point out the problems ? Is it caused by missing permission ? Or, I can only get invitable_friends for my game app with Canvas implemenation ?

Thank You. :)

Getting user_friends permission requires you to submit your app for facebook devs to review. If you just want the list of friends who have installed your app you can get that without the user_friends permission, by just doing a get call on :

https://graph.facebook.com/fb_id/friends?access_token= ...

Reference : https://developers.facebook.com/docs/graph-api/reference/user/friends

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM