2011-05-05 99 views
8

我正在使用Twitter登錄進入我的應用程序。但是,當我點擊Twitter的按鈕,打開Twitter頁面,但我得到了以下錯誤:使用Twitter登錄我的iPhone應用程序時出錯

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]; 
} 

我會如何解決這個問題?

+1

什麼'twitter button'?什麼'推特頁'?什麼'推特登錄'?你在MGTwitterEngine中使用OAuth嗎?你真的需要提供比這更多的信息。 – 2011-05-05 07:41:19

+1

- (無效)twitterclick { SA_OAuthTwitterEngine * _engine = [[SA_OAuthTwitterEngine的alloc] initOAuthWithDelegate:自]; engine.consumerKey = [[NSString alloc] init]; \t _engine.consumerSecret = [[NSString alloc] init]; \t \t _engine.consumerKey = @ 「應用消費的關鍵」; \t _engine.consumerSecret = @「App Consumer secret」; \t \t *的UIViewController控制器= [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine:_engine委託:自我]; \t \t 如果(控制器) \t \t \t \t \t \t [自我presentModalViewController:控制器動畫:YES]; } 是的,我在MGTWitterEngine使用OAuth – 2011-05-05 08:08:45

回答

3

我有同樣的問題......這竟然是與系統時間上我設備。

不知道它是如何發生的......但改變日期後,它的工作。

1

您嘗試使用OAuthData這是太老使用(已過期) 在MGTwitterEngine.m尋找 `#ENDIF

_secureConnection = YES; 
    _clearsCookies = NO;` 

,改變_clearsCookies = YES;

你「twitterClick」開始

然後把[self clearsCookies];那麼剩下的代碼

-(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]; }

0

只要將[_engine setClearsCookies:TRUE]重置爲_engine變量,它應該可以工作。這就是我爲它工作的原因!

相關問題