开发者

Facebook Checkins on Website

开发者 https://www.devze.com 2023-03-03 08:58 出处:网络
I have a website that has users regularly ch开发者_高级运维ecking in to with Facebook. I want to display the currently checked in users (name & avatar) on the homepage. I\'ve managed to achieve th

I have a website that has users regularly ch开发者_高级运维ecking in to with Facebook. I want to display the currently checked in users (name & avatar) on the homepage. I've managed to achieve this for people checking in with foursquare but can't work out how to do it with Facebook.

As far as I can tell checkins are extended permissions and require an access token. I've managed to generate an Access token using...

echo $token = file_get_contents('https://graph.facebook.com/oauth/access_token?client_id=[-APP ID-]&client_secret=[-APP SECRET-]&grant_type=client_credentials');

and appending the result to a checking request...

echo file_get_contents('https://graph.facebook.com/[-PAGE ID-]/checkins/?'.$token);

but all I get from that is:

400 Bad Request

I don't want visitors to the site to have to login to facebook & grant permissions to see checked in users... I just want to list account names and pictures.

Is this possible or am I dreaming?


Facebook does not allow you to see the checkins to a place unless the current user is friends with the person checked in.

https://graph.facebook.com/[-PAGE ID-]/checkins/?access_token=$token

will give you all the current users friends who have checked into [-PAGE ID-].


Did you mean:

echo file_get_contents('https://graph.facebook.com/[-PAGE ID-]/checkins/?access_token='.$token);

You forgot ?access_token=

0

精彩评论

暂无评论...
验证码 换一张
取 消