0
嗨,我們已經實現了下面的代碼FB.Data.query和哪裏可以找到Facebook數據庫方案?
INIT塊(WORKS)
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
});
登錄區塊(WORKS)
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'});
資料反演塊(請勿WORK)
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的「用戶」和「朋友」表的數據庫計劃的想法?其他可以通過「FB.Data.query」訪問的表?
謝謝!
EDIT
正確的數據RETRIEVE塊(作品)
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);
});
});
謝謝兄弟,你救了我。真的沒有辦法在Facebook開發者上找到它! – Igor