Archive/Unarchive

Archive/Unarchive Settings#

Archive Chats Permanent status can set by enabling/disabling the option.

    ChatManager.enableDisableArchivedSettings(_ status : Bool) { (isSuccess, flyError, resultDict) in
    if isSuccess {
    var flydata = resultDict
    print(flydata.getData())
    }else{
    //archive enable/disable failed
    }
    }
    ArgumentTypeDescription
    STATUSBooltrue to enable archive chat false to disable archive chat
    CALLBACKFlyCompletionHandlerFlyCompletionHandler used as completion Handler

    Check a user is UnArchived#

    To check whether the given jid was archived or not

    let isUnArchived: Bool = ChatManager.shared.isUserUnArchived(JID)
    ArgumentTypeDescription
    JIDStringjid of the user/group

    Archive Settings Status#

    Get Archive Settings Status to keep the archived chats permanent.

      let isEnabled:Bool = ChatManager.isArchivedSettingsEnabled()
      ChatManager.getArchivedSettingsStatusFromServer()
      info

      While user Logging the app, archived settings status will be synced from server by calling the method ChatManager.shared.getArchivedSettingsStatusFromServer() and status will be updated to ChatManager.shared.isArchivedSettingsEnabled()

      Archive/Unarchive a recent chat conversation#

      Archive:#

      Archiving a chat conversation makes the chat not appear in recent chat list, mostly used on chats which are inactive for a long time.

      UnArchive:#

      Unarchiving a archived recent chat conversation makes the chat conversation appear in recent chat list again.

        ChatManager.updateArchiveUnArchiveChat(_ jids : [String], _ status : Bool) { (isSuccess, flyError, resultDict) in
        if isSuccess {
        var flydata = resultDict
        print(flydata.getData())
        }else{
        //archive/unarchive chat failed
        }
        }
        ArgumentTypeDescription
        JIDS[String]jids of the user/group to Archive/UnArchive
        STATUSBooltrue to archive the recent chat false to unarchive the recent chat
        CALLBACKFlyCompletionHandlerFlyCompletionHandler used as completion Handler

        Get List of archived recent chat conversation#

        An archived chat won't be listed in recent chat list. To get the list of archived chats call the below method.

          ChatManager.getArchivedChatsFromServer() { (isSuccess, flyError, resultDict) in
          if isSuccess {
          var flydata = resultDict
          print(flydata.getData())
          }else{
          //Get archived chats failed
          }
          }
          ArgumentTypeDescription
          CALLBACKFlyCompletionHandlerFlyCompletionHandler used as completion Handler
          info

          While user Logging the app, if any chats archived then list will be synced by fetching this method ChatManager.getArchivedChatsFromServer() the list of Archived JIDs will update into ChatManager.getArchivedChatList().