User Presence

Enable/Disable hide seen status#

Hide Last seen status enables the user's last logged in time unavailable to their friends. To enable or disable the hide last seen status of the user call the below method.

    ChatManager.enableDisableHideLastSeen( EnableLastSeen: lastSeen) { isSuccess, flyError, flyData in
    var data = flyData
    if isSuccess {
    print(data.getMessage() as! String )
    } else{
    print(data.getMessage() as! String )
    }
    }
    ArgumentTypeDescription
    EnableLastSeenBooltrue enables the last seen available to friends false disables it
    CALLBACKFlyCompletionHandlerFlyCompletionHandler used as completion Handler

    Check last seen status#

    To check whether last seen status is available to friends or not, call the below method.

      var lastSeenStatus: Bool = ChatManager.isLastSeenEnabled()

      Get last seen status#

      To get whether last seen status is available to friends or not, call the below method.

        ChatManager.getUserLastSeen( for: JID_STRING) { isSuccess, flyError, flyData in
        var data = flyData
        if isSuccess {
        print(data.getMessage() as! String )
        print(data.getData() as! String )
        } else{
        print(data.getMessage() as! String )
        }
        }
        ArgumentTypeDescription
        JID_TO_GETLASTSEENStringJID of the user
        CALLBACKFlyCompletionHandlerFlyCompletionHandler used as completion Handler