简体   繁体   中英

Cannot Checkin Through FB.api (javascript)

With the javascript sdk (FB.api), I cannot checkin on behalf of user. (The user has granted publish_stream permission to my app)

Since facebook's API keeps changing, confused for some time. After searching and reading from internet, I think it's the right way to publish a checkin. Any help is appreciated.

var params = {
method: 'POST',
place: 107297282684980,
message: 'hi',
coordinates: {
'latitude': 22.204284439454,
'longitude': 113.54313260065
}};

FB.api(
'/me/checkins',
params,
function(response) {
if( response )
alert('Checkin Completed!');
});

It was deprecated at July 2013. You should check the changes from the URLs provided at the question comment.

And follow the instructions:

https://developers.facebook.com/docs/opengraph/overview/ https://developers.facebook.com/docs/opengraph/getting-started/

As FB Check-In is deprecated we can achieve the same thing with a post on FB with Location Attached using the following FB Graph Api post.

FB.api('/me/feed', 'post', {
    name: 'SomeName',
    message: 'SomeMessage',
    place: yourLocationID
}, function (response) {}); 

Note : Where yourLocationID is the ID that you will get by the Graph search using https://graph.facebook.com/search?q=yourPlaceName&type=page&access_token=YOURTOKEN

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM