Facebook JS SDK FB.Data.Query & query.wait 方法不返回某些 FQL 查询的结果
我正在使用 Facebook 的 JS SDK 和 FQL,试图获取某些查询的结果,我尝试的前两个查询 (fql) 工作得很好,后半部分则不起作用。
如果我调用 FB.getAccessToken() 并检索当前会话的访问令牌,然后使用该访问令牌来 ping FQL 端点,它会起作用:
https://api.facebook.com/method/fql.query?query=SELECT+name,+is_app_user+FROM+user+WHERE+uid+IN+(SELECT+uid2+FROM+friend+WHERE+uid1+=+ 504405294)&access_token=#############&format=json
有人知道为什么它在使用 FB JS SDK 时不起作用吗?
// var fql = 'SELECT pic_square, uid FROM user WHERE uid = 504405294 OR uid = 100002624783324 OR uid = 1634269784 OR uid = 100002917463525';
var fql = 'SELECT name, pic_square, sex FROM user WHERE uid = 100002624783324';
// var fql = 'SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())'; //ORDER BY is_app_user DESC LIMIT 0, 1000';
// var fql = 'SELECT uid2 FROM friend WHERE uid1 = 504405294';
console.log(fql);
var query = FB.Data.query(fql);
query.wait(function(rows){
console.log(rows);
});
编辑
更清楚一点,console.log(rows);调用 .wait() 永远不会发生。控制台一片空白。
I'm playing around with Facebook's JS SDK and FQL, trying to get results for some queries, the first two queries I try (fql) work perfectly fine, the latter half don't work.
If I call FB.getAccessToken() and retrieve my current session's access token, then use that access token to ping the FQL endpoint it works:
https://api.facebook.com/method/fql.query?query=SELECT+name,+is_app_user+FROM+user+WHERE+uid+IN+(SELECT+uid2+FROM+friend+WHERE+uid1+=+ 504405294)&access_token=#############&format=json
Anyone know why it doesn't work when using the FB JS SDK?
// var fql = 'SELECT pic_square, uid FROM user WHERE uid = 504405294 OR uid = 100002624783324 OR uid = 1634269784 OR uid = 100002917463525';
var fql = 'SELECT name, pic_square, sex FROM user WHERE uid = 100002624783324';
// var fql = 'SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())'; //ORDER BY is_app_user DESC LIMIT 0, 1000';
// var fql = 'SELECT uid2 FROM friend WHERE uid1 = 504405294';
console.log(fql);
var query = FB.Data.query(fql);
query.wait(function(rows){
console.log(rows);
});
Edit
To be a little more clear, the console.log(rows); call in .wait() never happens. The console is blank.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你好,你必须写一些这样的:
Hello you must write some like this: