I need to implement twitter login in my iOS app, I have installed twitter framework with fabric SDK. Now for the very first time I am facing the issue while loggin in. I can able to receive the token details
Twitter Details :@TestUserApp logged in! (796637020760186880)
Auth token:796637020760186880-ieeZM2Mbn3FLutLOcJ1sk7bp83ZSlzU
Auth Token secret:1G0O5YdF89V0VtoNmdY8W3ui2pkPNvKgtNPbqrleOiIoB
Error : Error Domain=TwitterAPIErrorDomain Code=99 "Request failed: forbidden (403)" UserInfo={NSLocalizedFailureReason=Twitter API error : Unable to verify your credentials (code 99), TWTRNetworkingStatusCode=403, NSErrorFailingURLKey=https://api.twitter.com/oauth2/token, NSLocalizedDescription=Request failed: forbidden (403)}
Full Code:
TWTRLogInButton *logInButton = [TWTRLogInButton buttonWithLogInCompletion:^(TWTRSession *session, NSError *error) {
if (session) {
NSString *authToken = session.authToken;
NSString *authTokenSecret = session.authTokenSecret;
NSString* userId = session.userID;
NSString *message = [NSString stringWithFormat:@"@%@ logged in! (%@) -Auth token:%@ -Auth Token secret:%@",
[session userName], [session userID],authToken,authTokenSecret];
// Objective-C
TWTRAPIClient *client = [[TWTRAPIClient alloc] init];
[client loadUserWithID:userId completion:^(TWTRUser *user, NSError *error) {
if (error == nil) {
NSLog(@"Name:%@ -- ScreenName:%@ -- ProfileImageUrl:%@",user.name,user.screenName,user.profileImageURL);
}
else {
NSLog(@"Error:%@",error.description);
}
}];
} else {
NSLog(@"Login error: %@", [error localizedDescription]);
}
}];