I've tried to integrate the STTwitter framework (Github project) for interacting with the Twitter API 1.1.
After I've create an app in my dev account, I've used the OAuth credentials for application only mode authentication. Anyway, I get the following error and I don't know how to fix it: Error Domain=STTwitterTwitterErrorDomain Code=220 "Your credentials do not allow access to this resource"
STTwitterAPI *twitter = [STTwitterAPI twitterAPIWithOAuthConsumerKey:@"XXX"
consumerSecret:@"XXX"];
[twitter verifyCredentialsWithSuccessBlock:^(NSString *bearerToken) {
NSLog(@"Access granted with %@", bearerToken);
} errorBlock:^(NSError *error) {
NSLog(@"-- error %@", error);
}];
Does anyone have a clue how to fix it?
This is because you didn't use the right
STTwitterAPI
constructor.Use
[STTwitterAPI twitterAPIAppOnlyWithConsumerKey:consumerSecret:]
instead and your example will work fine.I got the same problem. However it was caused by the Twitter account on the device not being setup properly - the password field was empty. After I've fixed that I could communicate with Twitter without a problem!