Facebook javascript sdk response empty -
Facebook javascript sdk response empty -
i'm trying facebook friends using facebook js sdk. code following:
<script> window.fbasyncinit = function() { fb.init({ appid : 'app_id_here', status : true,· cookie : true, xfbml : true, oauth : true, }); fb.getloginstatus(function(response) { if (response.status === 'connected') { fb.api('/me/friends', function(r){ if (r && !r.error){ console.log(r); } else { console.log('something goes wrong', r); } }); } }); }; //load sdk async (function(d){ var js, id = 'facebook-jssdk'; if (d.getelementbyid(id)) {return;} js = d.createelement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_us/all.js"; d.getelementsbytagname('head')[0].appendchild(js); }(document)); </script> <fb:login-button scope="user_friends,email" autologoutlink="true" onlogin="window.location = '#'"> </fb:login-button>
i'm getting response it's this:
object {data: array[0]}
what doing wrong?
please remove dot(.) sign after 'status:true'. not getting user becuase friends not using application.facebook has changed own api,we can't friends , friends using current application.
please read changelog:--
https://developers.facebook.com/docs/apps/changelog
javascript facebook facebook-graph-api
Comments
Post a Comment