Retrieve User Profile Data

Get User profile data#

To get the profile data of a user(not a group) call the below method.

    try? ContactManager.shared.getUserProfile(USER_JID,FETCH_FROM_SERVER,SAVE_AS_FRIEND){ isSuccess, flyError, flyData in
    var data = flyData
    if isSuccess {
    let profileDetail = data.getData() as! ProfileDetails
    } else{
    print(flyError!.localizedDescription)
    }
    }
    ArgumentTypeDescription
    USER_JIDStringJid of the user
    FETCH_FROM_SERVERBooltrue to fetch from server false will fetch from local database
    SAVE_AS_FRIENDBoolif true the user will be saved as friend and will be available in list of contacts to chat
    CALLBACKFlyCompletionHandlerFlyCompletionHandler used as completion Handler

    Get the list of User saved profile statuses#

    User can get their list of previously saved user statuses by calling the below method.

      var getAllStatus: [ProfileStatus] = ChatManager.getAllStatus()
      info

      This list contains some pre defined values. ProfileStatus reference document

      Get current User busy status#

      User can get their current user busy status using the below method.

        let myBusyStatus: BusyStatus = ChatManager.shared.getMyBusyStatus()

        Refer this doc to know more about BusyStatus Class

        Check User Busy status is enabled#

        User can check whether their busy status is enabled or disabled.

          let isMyBusyStatusEnabled: Bool = ChatManager.shared.isBusyStatusEnabled()

          Get the list of User saved busy statuses#

          User can get their list of previously saved user busy statuses by calling the below method.

            let myBusyStatusList: [BusyStatus] = ChatManager.shared.getBusyStatusList()
            info

            This list also contains some pre defined values.