forked from twitter-archive/twitter-kit-ios
-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
I cannot reproduced the issue, but I got +5k crash reports in this past few hours from our app.
Seems the crash is happened inside of TWTRAPIClient.
- (NSURLRequest *)URLRequestWithMethod:(NSString *)method URLString:(NSString *)URLString parameters:(nullable NSDictionary *)parameters error:(NSError **)error;
My code
private let client: TWTRAPIClient
func friendIds() -> Promise<[String]> {
Promise { resolver in
let request = client.urlRequest( // <-- Crashed here
withMethod: "GET",
urlString: "https://api.twitter.com/1.1/friends/ids.json",
parameters: ["stringify_ids": "1"],
error: nil
)
client.sendTwitterRequest(request) { (_, data, error) in
guard let data = data else {
let error = error.flatMap {
TwitterError(error: $0 as NSError)
} ?? TwitterError.illegalStateError
resolver.reject(error)
return
}
do {
let response = try self.decoder.decode(FriendIdsResponse.self, from: data)
resolver.fulfill(response.ids)
} catch {
resolver.reject(TwitterError(error: error as NSError))
}
}
}
}
Does anyone have same issue?
Metadata
Metadata
Assignees
Labels
No labels