简体   繁体   English

问题FB.api('/ me / likes /

[英]Issues FB.api('/me/likes/

I have problem with fb api. 我在使用FB API时遇到问题。

FB.api('/me/likes/pageid',function(response) {
console.log(response.data); 
});

i have 我有

Object
category: "Entertainment"
created_time: "2012-09-17T16:56:56+0000"
id: "pageid"
name: "site.com"

but on one computer i have undefined Object { data=[0]} 但是在一台计算机上,我有未定义的对象{data = [0]}

I logged in on both in facebook. 我在Facebook上都登录了。 any ideas? 有任何想法吗?

in FF i have 在FF我有

An active access token must be used to query information about the current user.

You have to specify a valid access_token 您必须指定一个有效的access_token

This is the right way to do that 这是正确的方法

FB.api('/me/likes/pageid', {access_token: "YOUR_ACCESS_TOKEN"}, function(response) {
   console.log(response.data); 
});

You have to add "user_likes" to the scope of your app to retrieve the result 您必须在应用范围内添加“ user_likes”才能检索结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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