diff --git a/SKWebAPI/Sources/WebAPI.swift b/SKWebAPI/Sources/WebAPI.swift index 78eef71..886cc42 100755 --- a/SKWebAPI/Sources/WebAPI.swift +++ b/SKWebAPI/Sources/WebAPI.swift @@ -1156,10 +1156,21 @@ extension WebAPI { } } - public func usersList(includePresence: Bool = false, success: ((_ userList: [[String: Any]]?) -> Void)?, failure: FailureClosure?) { - let parameters: [String: Any] = ["token": token, "presence": includePresence] + public func usersList(cursor: String? = nil, + limit: Int? = nil, + includePresence: Bool = false, + success: ((_ userList: [[String: Any]]?, _ nextCursor: String?) -> Void)?, + failure: FailureClosure?) { + var parameters: [String: Any] = ["token": token, "presence": includePresence] + if let cursor = cursor { + parameters["cursor"] = cursor + } + if let limit = limit { + parameters["limit"] = limit + } + networkInterface.request(.usersList, parameters: parameters, successClosure: {(response) in - success?(response["members"] as? [[String: Any]]) + success?(response["members"] as? [[String: Any]], (response["response_metadata"] as? [String: Any])?["next_cursor"] as? String) }) {(error) in failure?(error) }