您好我们已经实现了以下代码
INIT块(工作)
FB.init({
appId: 'apiID',
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
oauth: true, // enable OAuth 2.0
xfbml: true, // parse XFBML
frictionlessRequests: true
});
登录栏(工作)
FB.login(function(response) {
if (response.authResponse) {
console.log('User logged and fully authorize the app.');
} else {
console.log('User cancelled login or did not fully authorize.');
}
}, {scope: 'email,user_location,friends_location'});
DATA RETRIEVE块(不工作)
var friends = FB.Data.query('SELECT uid, name, location FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me() ORDER BY rand() LIMIT 15) AND has_added_app=0');
FB.Data.waitOn([friends], function() {
FB.Array.forEach(friends.value, function(row) {
console.log(row);
});
});
“SELECT uid,name FROM user ...”不会出现最后一个问题。
有没有人知道facebook的“用户”和“朋友”表格的DB方案?其他表可以通过“FB.Data.query”访问?
谢谢!
修改
CORRECT DATA RETRIEVE块( WORKs )
var friends = FB.Data.query('SELECT uid, name, hometown_location, current_location FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me() ORDER BY rand() LIMIT 15) AND has_added_app=0');
FB.Data.waitOn([friends], function() {
FB.Array.forEach(friends.value, function(row) {
console.log(row);
});
});