简体   繁体   中英

How to retrieve user ids of all users of a fb graph application?

I cannot find a method in restfb to find all the userids of the users who have connected to my facebook application. I am using fbgraphapi version 3.2

I have tried an old method, friends.getAppUsers, but found that it did not work. I cannot find a query in the graph api explorer v3.2 that would retrieve user ids either.

In graph api explorer I have:

my_app_id?fields=id,name

but then I cannot find any fields or connections that would retrieve the user ids of those using my app. In my application:

private static final String MY_APP_ID = "myappid";
private static final String MY_APP_SECRET = "myappsecret";
private static final String MY_ACCESS_TOKEN = "myaccesstoken"; 

public static void main(String[] args) {
        String accessToken = new DefaultFacebookClient(MY_ACCESS_TOKEN, Version.LATEST).obtainExtendedAccessToken(MY_APP_ID, MY_APP_SECRET, MY_ACCESS_TOKEN).getAccessToken();
        FacebookClient facebookClient = new DefaultFacebookClient(accessToken, Version.VERSION_2_10);

I have facebookClient but I assume this is at the user level so I'm not sure if in restfb I can query at the app level to find the list of user ids.

There is no API to get all users who authorized your App. The only way to get that list is to store them when they authorize (or re-visit) your App.

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