Browse Source

Added notifications to API document and tested.

master
Monique Solanki 6 years ago
parent
commit
e1b47e4c85
  1. 17
      elpha-ios/MastodonAPI.swift

17
elpha-ios/MastodonAPI.swift

@ -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 = [

Loading…
Cancel
Save