self.twitter = [STTwitterAPI twitterAPIWithOAuthConsumerKey:@"myConsumerKey"
consumerSecret:@"myConsumerSecret"];
[self.twitter postTokenRequest:^(NSURL *url, NSString *oauthToken) {
NSLog(@"-- url: %@", url);
NSLog(@"-- oauthToken: %@", oauthToken);
} authenticateInsteadOfAuthorize:NO
forceLogin:@(YES)
screenName:nil
oauthCallback:@"myapp://twitter_access_tokens/"
errorBlock:^(NSError *error) {
NSLog(@"-- error: %@", error);
}];
上面的代码适用于 iOS7,但在 iOS8 中出现错误:- Error Domain=STHTTPRequest Code=401 "HTTP Status 401: Unauthorized"