我正在使用此方法获取访问令牌:
function _getToken(callback){
FB.api('oauth/access_token', {
client_id: fbSettings.client_id,
client_secret: fbSettings.client_secret,
grant_type: fbSettings.grant_type
}, function (res) {
console.log(res);
if(res.error) {
callback('error getting token: ', res.error);
return;
}
callback(null, { token: res.access_token, expires: res.expires });
});
}
然后我正在调用此查询:
SELECT online_presence, name FROM user WHERE uid = ...
但是响应在线状态是空字符串,因为我生成的令牌没有权限user_online_presence
。如何在生成令牌时设置此权限?