gpt4 book ai didi

javascript - 在javascript中获取应用程序用户

转载 作者:行者123 更新时间:2023-11-30 10:48:01 25 4
gpt4 key购买 nike

我正在尝试在 javascript sdk 中获取应用程序用户。为什么这不起作用?

var q = FB.Data.query('SELECT uid FROM user WHERE uid IN '
+ '(SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1');

q.wait(function(resp) {
console.log(resp);
}
);

返回[]

然而这很好用:

var q = FB.Data.query('SELECT uid2 FROM friend WHERE uid1 = me()');
q.wait(function(resp) {
var l = [];
for (var i in resp) {
l.push(resp[i].uid2)
}
var fql = 'SELECT uid FROM user WHERE uid IN (' + l.join(',') + ') and is_app_user = 1';
var q1 = FB.Data.query(fql);
q1.wait(function(resp) {
console.log(resp);
});
}
);

第二个语句的问题是将所有 friend 加载到浏览器中,它又发出一个请求。为什么第一个语句不起作用?

最佳答案

尝试将 is_app_user 视为 bool 值:(仅使用 fql 对我有用)

var q = FB.Data.query('SELECT uid FROM user WHERE uid IN ' + '(SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user');

关于javascript - 在javascript中获取应用程序用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7192745/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com