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