Retrieve Group Data

Get Group Profile#

To get a group profile from server or local, call below method.

    try GroupManager.shared.getGroupProfile(groupJid: groupId, fetchFromServer: fromServer, completionHandler: { isSuccess, flyError, flyData in
    if isSuccess {
    let data = (flyData.getData() as? ProfileDetails)
    // Update the UI
    } else{
    // failure case of get group profile
    }
    })
    ArgumentTypeDescription
    groupJidStringgroupJid of a group
    fetchFromServerBoolif fetchFromServer is true, prfoile details will be fetched from server or else (false) from local
    completionHandlerFlyCompletionHandlercallback to get success or failure response. implemented as closure expression

    Get Participants#

    To get group members from the server, call below method

      GroupManager.shared.getParticipants(groupJID: groupId)
      ArgumentTypeDescription
      groupJidStringgroupJid of a group
      info

      if getParticipants(groupJID: groupId) is success, didFetchGroupMembers(groupJid: String) method will be called, which is defined in GroupEventsDelegate.

      Get Group Members from Local#

      To get group member from local DB, call below method.

        let groupMembers: [GroupParticipantDetail] = GroupManager.shared.getGroupMemebersFromLocal(groupJid : groupId)
        ArgumentTypeDescription
        groupJidStringJid of a group
        ReturnsTypeDescription
        (participantDetailArray : [GroupParticipantDetail] , message : String)Tuple ([GroupParticipantDetail] ,String)[GroupParticipantDetail] array of participant detail. message : response message

        Participant Existance in a Group#

        To check a participant existance in a group, call below method

          let (isExist, message) = GroupManager.shared.isParticiapntExistingIn(groupJid: groupId, participantJid: jid)
          ArgumentTypeDescription
          groupJidStringJid of a group
          participantJidStringparticipantJid to check existance in the group
          ReturnsTypeDescription
          (doesExist : Bool, message : String)Tuple (Bool,String)doesExist is true, if participantJid is existing in the group. message : response message

          Check admin user#

          To check a member is admin, call below method

            let (isAdmin, message) = GroupManager.shared.isAdmin(participantJid : jid, groupJid : groupId)
            ArgumentTypeDescription
            groupJidStringJid of a group
            participantJidStringparticipantJid to check admin user
            ReturnsTypeDescription
            (isAdmin : Bool,message :String)Tuple (Bool,String)isAdmin is true, if participantJid is admin. message : response message

            Get Group Count#

            To get group count from local DB, call below method

              let groupCount: Int = GroupManager.shared.getGroupCount()
              Return TypeDescription
              Intreturns the count of group from local DB