Facebook SDK,如何检查用户是否已接受我的权限? [英] Facebook SDK, How do I check if a user has accepted my permissions?

查看:117
本文介绍了Facebook SDK,如何检查用户是否已接受我的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用程序中,用户可以通过Facebook SDK登录。应用程序请求读取和发布权限。有没有办法检查他们是否接受发布权限才能继续进行?权限是publish_actions。我尝试做 Session.getPermissions(); ,但只有读取权限列在那里(basic_info,user_birthday,user_friends)

I've got to a point in my app where a user can login via the Facebook SDK. The app requests read and publish permissions. Is there a way to check if they have accepted the publish permissions before carrying on? The permission is "publish_actions". I tried doing Session.getPermissions(); but only the read permissions are listed there (basic_info, user_birthday, user_friends).

似乎没有办法检查用户是否接受了我的发布权限,是否有可能的解决方法?

It seems like there is no way to check if the user accepted my publish permission, is there a possible workaround to this?

我需要检查的原因是因为用户可以随时从他们的个人资料中撤销权限,所以我不能让他们登录,然后撤销权限,否则会打败要求的目的。

The reason I need to check for this is because the permissions can be revoked by the user at any time from their profile, so I can't have them login then revoke the permissions, otherwise that would defeat the purpose of asking for it.

真的很感激一些帮助,谢谢。希望这是可能的,而不是Facebook的限制(虽然我可以看出为什么如果是)。

Would really appreciate some help, thank you. Hopefully it's possible and not a Facebook restriction (Although I can sort of see why if it was).

推荐答案

对于你的应用程序,您可以使用任何有效的用户访问令牌,并调用/ me / permissions,它将返回用户授予您的应用程序的权限列表。

For your app, you can use any valid user access token, and make a call to /me/permissions, and it will return a list of permissions that the user has granted your app.

有关更多文档,请参阅 https://developers.facebook.com/docs / graph-api / reference / user / permissions /

For more docs, see https://developers.facebook.com/docs/graph-api/reference/user/permissions/

这篇关于Facebook SDK,如何检查用户是否已接受我的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆