私は古典的なBen GottliebのTwitter Open Sourceプロジェクトを使用して、iPad用のTwitterログインを作成しています。objective-c:iPadでのTwitterのログインエラー:Whoa there
私のコードエンジンをインスタンス化し、ログインコントローラを表示するには、次のとおりです。
またif (!_engine) {
_engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];
[_engine setConsumerKey:@"kConsumerKey"];
[_engine setConsumerSecret:@"kConsumerSecret"];
}
if (![_engine isAuthorized]){
UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine:_engine delegate:self];
if (controller){
if ([controller respondsToSelector:@selector(setModalPresentationStyle:)] == YES) {
controller.modalPresentationStyle = UIModalPresentationFormSheet;
}
[self presentModalViewController:controller animated:YES];
return;
}
}
、私はhttpsにSA_OAuthTwitterEngineのURLを設定します。
self.requestTokenURL = [NSURL URLWithString: @"https://twitter.com/oauth/request_token"];
self.accessTokenURL = [NSURL URLWithString: @"https://twitter.com/oauth/access_token"];
self.authorizeURL = [NSURL URLWithString: @"https://twitter.com/oauth/authorize"];
とMGTwitterEngine.mの私TWITTER_DOMAINが
#define TWITTER_DOMAIN @"api.twitter.com/1"
に変更されました。 iPhoneとiPadの両方のシミュレータが魅力的に機能します。
Whoa there! The request token for this page is invalid. It may have already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake
(スクリーンショットを添付):私はiPadのデバイス上でこのコードをテストするたびは、しかし、私はこのエラーをスローしています。表示されるように、標準のログイン画面を取得する方法について
任意の提案を大幅に私は同じ問題に遭遇した
Jeff Kelleyあなたは、このコード行をどこに追加すればよいか教えてください。[myEngine requestRequestToken]; – Gypsa
エンジンを作成する場所に追加します。 –
エンジンの作成場所を追加しようとしましたが、動作しませんでした。 – Gypsa