I am using Twitter login to enter in my app. But when I click on the Twitter button, the Twitter page opens, but I get the following error:
WHOA there!!! This page is no longer valid.it looks like someone already used the token information you provide.please return to the site tht sent you to this page or try again. it was an probably an honest mistake.
-(void)twitterclick
{
SA_OAuthTwitterEngine *_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self]; engine.consumerKey=[[NSString alloc]init];
_engine.consumerSecret=[[NSString alloc]init];
_engine.consumerKey = @"App consumer key";
_engine.consumerSecret = @"App Consumer secret";
UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self];
if (controller)
[self presentModalViewController:controller animated:YES];
}
How might I resolve this?
I had the same problem... it turned out to be related to the system time on my device.
Not sure how it happened.. but after changing the date, it worked.
your trying to use OAuthData that's too old for use(expired) in MGTwitterEngine.m look for `#endif
_secureConnection = YES;
_clearsCookies = NO;`
and change _clearsCookies=YES;
then at the start of your 'twitterClick' put [self clearsCookies];
then the rest of your code
-(void)twitterclick {
[self clearsCookies]; SA_OAuthTwitterEngine *_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self]; engine.consumerKey=[[NSString alloc]init]; _engine.consumerSecret=[[NSString alloc]init]; _engine.consumerKey = @"App consumer key"; _engine.consumerSecret = @"App Consumer secret"; UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine: _engine delegate: self]; if (controller) [self presentModalViewController:controller animated:YES]; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With