javascript - Access non-public data using Facebook Graph Api -
i trying user data(/me) & friends data(/me/friends) using function fires after login through facebook. using javascript sdk
//getting logged in user data// function users(callback) { fb.api('/me?fields=name,first_name,username,birthday,hometown,albums,photos,location,picture.height(100).width(100),cover', function(response) { callback(response); }); } //getting logged in user friends data// function pic(album_id, callback) { fb.api("/" + album_id + "/photos", function(response) { callback(response); }); }
by using able access public data of logged in user, not able access data limited permission(such my location & hometown set visible my friends only).
app dashboard permissions:
you can access fields such hometown,location etc. user using following code, asks authorization when login app using facebook.
fb.login(function(response) { }, { scope: 'user_location,user_hometown,user_photos,friends_location' });
Comments
Post a Comment