Hi.
I’m using Fabric TwitterKit 2.4.0 in my app.
I’m trying to tweet statuses/update endpoint using the TWTRAPIClient. However when it includes the following characters, an error is returned.
^ < > \ | `
TWTRAPIClient *client = [[TWTRAPIClient alloc]initWithUserID:userID];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
parameters[@"status"] = @"^";
// When replacing the "^" to "%5E", "%5E" will be posted as it is.
NSURLRequest *request = [client URLRequestWithMethod:@"POST" URL:@"https://api.twitter.com/1.1/statuses/update.json" parameters:parameters error:nil];
[client sendTwitterRequest:request completion:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) {
NSLog(@"%@",connectionError);
}];
I get the following error
Error Domain=TwitterAPIErrorDomain Code=32 "Request failed: unauthorized (401)" UserInfo={NSLocalizedFailureReason=Twitter API error : Could not authenticate you. (code 32), TWTRNetworkingStatusCode=401, NSErrorFailingURLKey=https://api.twitter.com/1.1/statuses/update.json, NSLocalizedDescription=Request failed: unauthorized (401)}
-
I’m using the consumerKey and consumerSecret that has been generated by the Fabric, and I input it into info.plist.
-
I tried NSURLSession, it was the same failure.
-
When I used Social.framework, it succeeds.
What should I do?
Thanks