Reputation: 6608
I'll be creating a Facebook app and I wish to restrict it to a single facebook group. Means, my facebook app could be used by the members of a particular group (say, "ABC Group").
I'm using PHP. I would also allowI'm using PHP. I would also allow the members(if he/she belongs to that particular group) to enter some text in my app. So, I need to validate whether the user belongs to a particular group and I would also require this user's name(and FB id) to be stored in my db.
Any help would be greatly appreciated.
Thank you :)
EDIT:
I have resolved it by constantly reading the documentation for several hours. :)
Upvotes: 0
Views: 333
Reputation: 6608
Inorder to check whether a member resides in a particular group, I used FQL: SELECT uid FROM group_member WHERE gid = GID AND uid =UID
Where GID is group's id and the UID is the user's id. Then this is executed and the output is stored in an array. Then checked the count of the first array element. If it is 0, then the user is not a member of this group. Otherwise, is a member. Hope this helps someone :)
Upvotes: 2