javascript - FB SDK Version 2.4 not returning value for /me/groups -
i trying user's groups list following code:
$(document).ready(function() { $("#fetchbutton").click(function() { console.log('fetch button'); fb.getloginstatus(function(res){ if( res.status == "connected" ){ // check if logged in // user data first, handled anonymours fucntion passed inline fb.api('/me', function(meresponse) { //console.log(meresponse); uid = meresponse.id; getgroups(); console.log(meresponse); }); } else { // if not logged in, call login procedure fb.login(function(){ $("#fetchbutton").click(); }, {scope: 'publish_actions, publish_actions, read_stream, user_groups'}); } }); }); }); function getgroups() { fb.api('/me/groups', function(groupresponse) { console.log(groupresponse); }); }
this code used work old version of fb sdk. not now.
any help!
read_stream
, user_groups
deprecated , using publish_actions
2 times. in order list of groups manage, need use user_managed_groups
now.
more information: https://developers.facebook.com/docs/apps/changelog#v2_4
Comments
Post a Comment