Login by STTwitterAPI error domain

417 Views Asked by At

my app use login Twitter function, It worked on all device except iPhone 5. I don't know the reason so decide to post the question here. My code for login is:

self.twitter = [STTwitterAPI twitterAPIWithOAuthConsumerKey:Twitter_API_KEY
                                             consumerSecret:Twitter_API_SECRET];


[self.twitter postTokenRequest:^(NSURL *url, NSString *oauthToken) {

    [[UIApplication sharedApplication] openURL:url];

} authenticateInsteadOfAuthorize:NO
                forceLogin:@(YES)
                screenName:nil
             oauthCallback:@"com.twitteroauthcallback.sutrixsnowball://twitter_access_tokens/"
                errorBlock:^(NSError *error) {
                    NSLog(@"-- error: %@", error);
                }];

But it's log the error when I run on iPhone 5:

Error Domain=STHTTPRequest Code=401 "HTTP Status 401: Unauthorized" UserInfo=0x178270040 {NSLocalizedDescription=HTTP Status 401: Unauthorized}
0

There are 0 best solutions below