Facebook图表 - 如果用户是用户组成员的组合,可以检查user_groups? [英] Facebook Graph - Possible To Check If A User Is A Member Of A Group w/o user_groups?

查看:117
本文介绍了Facebook图表 - 如果用户是用户组成员的组合,可以检查user_groups?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Wordpress / Facebook插件的作者,多年来,网站通过允许/拒绝登录,根据用户是否是Facebook上的私人组织成员,使网站能够创建WP社区。突然 - 在典型的Facebook时尚 - 他们打破了它,现在说:


user_groups的权限只允许人们使用
在Facebook尚不可用的平台上使用Facebook。如果您在Android和iOS上构建一个应用程序
,例如,您将不会获得
的此权限。网页,桌面和电视应用程序也不会获得这个权限


参考:



以前,我正在通过/ group-id / members终端确定用户是否是组的成员,并查找当前用户该小组的成员名单。这需要现在不可能的user_groups权限,因此不起作用。 / user / groups端点也需要user_groups,也不会工作。我发现参考另一种方式使用FQL( facebook图表api检查用户是否是使用PHP的组的成员),据称不需要user_groups,但他们也杀死了FQL。



所以当我很确定我知道答案时,我只想伸出援手,看看是否有任何可能的解决方法,可能会帮助我避免杀死这个极受欢迎的功能:其他一些允许/禁止用户基于成员组成。只是寻找一些开箱即用的想法 - 或者考虑到群组功能完全失去并永远消失吗?



感谢您可能有任何想法。 ..

解决方案

我面临同样的问题,我得出结论,你可以想像:没有直接确定用户是否为特定组的成员,除非您具有 user_group 权限。



在时刻,我发现唯一的解决方法是将用户的ID存储在数据库中,以及一个变量,他告诉我他是否是我的组的成员;我手动更新此变量,定期比较我的组成员列表和用户数据库。



请记住,如果您是组的管理员,您可以随时获取其成员列表没有任何许可(这是我使用的代码: $ members = $ facebook-> api('/'.$ userGroupId。'/ members','GET'); )。



一旦你有这个列表,你可以用它来更新用户数据库的布尔变量is_member。



当然不是最优雅的解决方案,但据我所知,没有太多的选择...



无论如何,你也可以跟随该选择的答案解释了该方法:群组成员的Facebook登录


I'm the author of a Wordpress/Facebook plugin that for many years has given sites the ability to create WP communities by permitting/rejecting logins based on whether or not users are members of their private group on Facebook. Suddenly - in typical Facebook fashion - they broke it, and now state:

The user_groups permission is only approved for apps that let people use Facebook on platforms where Facebook is not already available. If you're building an app on Android and iOS, for example, you won't be approved for this permission. Web, Desktop and TV apps will also not be granted this permission.

Reference: https://developers.facebook.com/docs/facebook-login/permissions/v2.3

Previously, I was determining whether or not a user is a member of a group via the /group-id/members endpoint, and looking for the current user among the group's members list. This requires the now-impossible user_groups permission, and thus won't work. The /user/groups endpoint also requires user_groups, and won't work either. I found reference to another way using FQL (facebook graph api check if user is a member of a group using PHP) that supposedly didn't require user_groups, but they've killed FQL too.

So while I'm pretty sure I know the answer, I just wanted to reach out and see if there's any possible workaround that might help me avoid killing this extremely-popular feature: some other way to allow/disallow users based on membership to a group. Just looking for some outside-of-the-box thinking - or is it safe to consider Groups functionality completely lost and gone forever?

Thanks for any ideas you may have...

解决方案

I'm facing the same problem, and I've come to the conclusion you can imagine: there is no straight way to determine if a user is member of a certain group unless you have the user_group permission.

At the moment, the only workaround I've found is to store users' IDs in a database, together with a variable who tells me if he's a member of my group or not; I "manually" update this variable, periodically comparing my group's member list with the users database.

Remember that if you are administrator of a group, you can always get its member list without any permission (this is the code I use: $members = $facebook->api('/'.$userGroupId.'/members','GET');).

Once you have this list, you can use it to update the boolean variable "is_member" of your users' database.

Surely not the most elegant solution, but as far as I know there are not so many alternatives...

Anyway you could also follow the approach explained in the selected answer to this question: Facebook login for group members

这篇关于Facebook图表 - 如果用户是用户组成员的组合,可以检查user_groups?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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