目前我打电话requestNewPublishPermissions
请求publish_stream
许可。
有没有办法让我查看用户是否已经授权了该权限,所以我不需要再次询问?
我认为Session.isPublishPermission("publish_stream")
可能是这样,但它似乎与预期的行为不符。
目前我打电话requestNewPublishPermissions
请求publish_stream
许可。
有没有办法让我查看用户是否已经授权了该权限,所以我不需要再次询问?
我认为Session.isPublishPermission("publish_stream")
可能是这样,但它似乎与预期的行为不符。
To check if the user has already authorized a permission, you have to call the API:
\GET /me/permissions
You'll get the response in the format:
{
"data": [
{
"installed": 1,
"basic_info": 1,
"public_profile": 1,
"publish_stream": 1,
"user_notes": 1,
"user_friends": 1
}
],
}
If this have the "publish_stream": 1
permission that means the user has authorized the app to publish on his behalf.
Code (if using android SDK)-
new Request(
session,
"/me/permissions",
null,
HttpMethod.GET,
new Request.Callback() {
public void onCompleted(Response response) {
/* handle the result */
}
}
).executeAsync();