【发布时间】:2016-10-19 19:01:08
【问题描述】:
我正在使用 facebook SDK for oauth 构建一个 android 应用程序。我有一个访问令牌和用户 ID。
当我使用该令牌和用户 ID 发出 http 请求时,我得到了这个 json:
{
"name": "Robel Alemu",
"id": "994449194002838"
}
但既然该令牌对public_profile 和user_friends 都具有权限,为什么我只得到名称和ID?
这是我的代码:
new GraphRequest(
AccessToken.getCurrentAccessToken(),
loginResult.getAccessToken().getUserId(),
null,
httpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
Toast.makeText(getApplicationContext(),response.toString(),Toast.LENGTH_SHORT).show();
/* handle the result */
}
}
).executeAsync();
这是我调试得到的令牌图片
【问题讨论】:
-
你需要在请求中指定你想要的字段
标签: android facebook facebook-graph-api oauth