2013-05-10 48 views
0

我在facebook应用程序选项卡中遇到了facebook jql和javascript sdk的问题。如果用户登录,那么我想阅读,如果用户是页面的粉丝。如果是这样,重定向到一个特定的粉丝页面,否则重定向到另一个页面。但由于种种原因,该FQL结果集是空的(但我页面的管理员,并且它当然风扇;-))的与facebook fql阅读页面粉丝混淆

这里是一个代码片段:

if (response.status === 'connected') { 
// The response object is returned with a status field that lets the app know the current 
// login status of the person. In this case, we're handling the situation where they 
// have logged in to the app. 
FB.api({ 
method:  'fql.query', 
query: 'SELECT uid FROM page_fan WHERE uid=me() AND page_id=188705819498' 
}, function(resp) { 
if (resp.length) {   

self.location.href = 'fanpage.html'; 
} else { 
self.location.href = 'infopage.html'; 
} 
} 
);  
+0

你有'user_likes'权限吗? – 2013-05-10 10:21:44

回答

2

你需要user_likes许可阅读他/她的喜好。尝试一下,如果它没有帮助尝试PHP SDK。当JavaScript和PHP返回不同的结果时,我遇到了这样的问题。

+0

thx为您提供帮助 – user1136199 2013-05-10 10:42:53