Facebook: get list of pages that a user is admin of

后端 未结 10 527
陌清茗
陌清茗 2020-12-07 08:50

I\'m using the graph api.

I have a logged in user, and want to get back a list of page ids of all the pages that the user is an admin of.

Is there a way of d

10条回答
  •  难免孤独
    2020-12-07 09:14

    You ask for the permission with the JavaScript SDK on login

    FB.login(function(){}, {perms:'manage_pages'});
    

    and then once they log in you can retrieve the pages (and apps) as follow :

    FB.api('/me/accounts', function(response){
        console.log(response);
    })
    

提交回复
热议问题