Retrieve Group Data

Get profile data#

To get the detail of a group call the below method.

GroupManager.getGroupProfile(GROUP_JID,FETCH_FROM_SERVER, (isSuccess, throwable, data) ->
if(isSuccess){
ProfileDetails groupProfileDetails = (ProfileDetails) data.get("data")
// Update the UI
}else{
// Fetching group data failed print throwable to find the exception details.
}
});
ArgumentsTypeDescription
GROUP_JIDStringJid of the group
FETCH_FROM_SERVERbooleanif true fetches data from the server else from local database
CALLBACKFlyCallbackFlyCallback implemented as lambda expression

Get Group Members#


To fetch all the groups members of a group call the below method.

GroupManager.getGroupMembersList(GET_SERVER_DATA,GROUP_JID, (isSuccess, throwable, data) ->
if(isSuccess){
ArrayList<ProfileDetails> groupsMembersProfileList = data.get("data")
// Update the UI
}else{
// Fetching group members list failed print throwable to find the exception details.
}
});
caution

Fetching group members from a server will be called internally when required. So , unless it was necessary set false for getServerData.

ArgumentTypeDescription
GET_SERVER_DATAbooleanif true fetches data from the server else fetches data from local database
GROUP_JIDStringJid of the group
CALLBACKFlyCallbackFlyCallback implemented as lambda expression

Validate Members list server call#

To check whether a server call to get the members list for a group is required or not call the below method.

boolean doesServerCallRequired = GroupManager.doesFetchingMembersListFromServedRequired(GROUP_JID);
ArgumentTypeDescription
GROUP_JIDStringJid of the group

Check User is a member#


To check whether a user of a given jid is a member of the group

boolean isMember = GroupManager.isMemberOfGroup(GROUP_ID, USER_JID);
ArgumentTypeDescription
GROUP_IDStringJid of the group
USER_JIDStringJid of the user

Check group admin#

User can able to check some participant of the group is a admin or not to the group. The below method can be used to check someone admin or not.The below method will return true if userJid is admin for the provided groupJid.

boolean isAdmin = GroupManager.isAdmin(GROUP_JID, USER_JID);
ArgumentTypeDescription
GROUP_JIDStringJid of the group
USER_JIDStringJid of the group participant

Group members count#


To get count of members in a group call the below method.

int groupMembersCount = GroupManager.getMembersCountOfGroup(GROUP_JID);
ArgumentsData typeDescription
GROUP_JIDStringJid of the group