A facebook user can control multiple pages. For example, a user can have their personal facebook account, their public figure page and their business page. This shows up as three distinct accounts with their own User
information in facebook's server.
I want to list these things, how can I retrieve what these accounts are using the Facebook SDK?
I feel like it has to do with the Request.newMeRequest
method, but this returns a GraphUser
object.
and the Request.newMyFriendsRequest
returns a list of users, but not a list of the personal account's connected accounts.
I am now using this 我现在正在使用这个
new com.facebook.Request(
session,
"/me/accounts",
null,
HttpMethod.GET,
new com.facebook.Request.Callback() {
@Override
public void onCompleted(com.facebook.Response response) {
if(response!=null && response.getGraphObjectList()!=null){
}
}
}
).executeAsync();
but response
is null. My session has the manage_pages
permission requested as well
I tried replacing "/me/accounts"
with "/"+userId+"/accounts"
and I still get back a null response. 我尝试用"/me/accounts"
"/"+userId+"/accounts"
替换"/me/accounts"
"/"+userId+"/accounts"
,但我仍然返回空响应。 Baffling.
Insight appreciated
You can test this procedure at Graph Api Explorer -> Just click on 'Get Access Token' button-> under 'Extended permission' check 'manage_pages' & submit it. It will give you the admin-page-details JSON. And please see Graph API Reference /{user-id}/accounts
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.