|
|
@ -404,6 +404,23 @@ class MastodonAPI { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static func notifications( |
|
|
|
limit: Int?, |
|
|
|
pagination: PaginationItem?, |
|
|
|
completion: @escaping (JSONObjectArray?, [PaginationItem]?, Error?) -> Void |
|
|
|
) { |
|
|
|
let parameters: Parameters = ["limit": limit ?? 20] |
|
|
|
|
|
|
|
self.request(path: "api/v1/notifications", method: .get, parameters: parameters, pagination: pagination) { data, pagination, error in |
|
|
|
guard error == nil else { |
|
|
|
completion(nil, nil, error) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
completion(data as? JSONObjectArray, pagination, nil) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static func registerApp(serverURL: URL, completion: @escaping (JSONObject?, Error?) -> Void) { |
|
|
|
let requestURL = serverURL.appendingPathComponent("api/v1/apps") |
|
|
|
let parameters: Parameters = [ |
|
|
|