attempting to get the number of friends from facebook api - android

后端 未结 1 1322
-上瘾入骨i
-上瘾入骨i 2020-12-22 14:20

I am attempting to the number of friends from facebook authentication api in an android application needed to call facebook permission api. Below is a snippet I am using

相关标签:
1条回答
  • 2020-12-22 14:52

    As per the facebook developer api /{user-id}/friends

    1.the User's friends who have installed the app

    2.the User's total number of friends (including those who have not installed the app making the query)

    After getting facebook token you can use this implementation

         GraphRequest request = GraphRequest.newGraphPathRequest(
          accessToken,
          "/{user-id}/friends",
          new GraphRequest.Callback() {
            @Override
            public void onCompleted(GraphResponse response) {
              // Insert your code here
            }
        });
    
        request.executeAsync();
    

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

    0 讨论(0)
提交回复
热议问题