Manage a Group

Add user to Group#

To add users to a group call the below method.

Mirrorfly.addUsersToGroup(jid: GROUP_JID,userList: NEW_USERS_JID_LIST, flyCallBack: (FlyResponse response) {
if(response.isSuccess){
// Update the UI
}else{
// Adding users to group failed print throwable to find the exception details.
}
});
ArgumentTypeDescription
GROUP_JIDStringJid of the group
NEW_USERS_JID_LISTList<String>Jid list of the new users
flyCallbackFlyResponsecallback to observe the action status

Remove a group member#

To remove a user from group call the below method.

Mirrorfly.removeMemberFromGroup(groupJid: GROUP_JID, userJid: REMOVING_MEMBER_JID, flyCallBack: (FlyResponse response) {
if(response.isSuccess){
// Update the UI
}else{
// Removing a user from group failed print throwable to find the exception details.
}
});
ArgumentTypeDescription
GROUP_JIDStringJid of the group
REMOVING_MEMBER_JIDStringJid of the user who is going to be removed
flyCallbackFlyResponsecallback to observe the action status

Make participant as admin#

User can able to make some participant of the group as a admin to the group. The below method can be used to make someone as admin. only admins can perform this action

Mirrorfly.makeAdmin(groupJid: GROUP_JID,userJid: NEW_ADMIN_JID, flyCallBack: (FlyResponse response) {
if(response.isSuccess){
// Update the UI
}
})
ArgumentTypeDescription
GROUP_JIDStringjid of the group
NEW_ADMIN_JIDStringjid of the group participant
flyCallbackFlyResponsecallback to observe the action status

Leave from a group#

To leave from a group in which you are a member call the below method.

Mirrorfly.leaveFromGroup(userJid: USER_JID ,groupJid: GROUP_JID, flyCallBack: (FlyResponse response) {
if(isSuccess){
// Update the UI
}else{
// Leaving from group failed print throwable to find the exception details.
}
});
ArgumentTypeDescription
GROUP_JIDStringJid of the group
USER_JIDStringjid of the participant, to exit from the group
flyCallbackFlyResponsecallback to observe the action status