You can use the SDK to show all groups as a member:
https://developers.facebook.com/docs/graph-api/reference/user/groups/
You will need the permission user_groups
and / or user_managed_groups
to list the groups that the member manages.
Endpoint is "/{user-id}/groups"
or "/me/groups"
if it is to show the groups of the member that is authenticated.
As an example, copy the code below and put it on the Facebook test page , click on "Run code" (blue button) and then click on the link that will show below the box where you put the code that will say "Show my groups"
<a href="#" id="run-btn">Mostra os meus grupos</a>
<ul id="groups"></ul>
<script type="text/javascript">
document.getElementById('run-btn').onclick = function() {
FB.login(function(response) {
if (response && !response.error) {
console.log("Login ------------------------------");
console.log(response);
getAllGroups(response.authResponse.userID);
} else {
// o utilizador nao deu permissoes...
}
}, {scope: 'user_groups'});
return false;
}
function getAllGroups() {
FB.api("/me/groups", function (response) {
console.log("Groups ------------------------------");
console.log(response);
if (response && !response.error) {
for(i=0; i<response.data.length; i++) {
var group = response.data[i];
document.getElementById("groups").innerHTML +=
"<li><a href='https://www.facebook.com/groups/" + group.id + "'>" + group.name + "</a> (" + group.id + ")</li>";
}
}
});
}
</script>
return code above: