Open sveltema opened 13 years ago
I agree, this should be adjusted at some point. Thanks for pointing this out!
B
On May 26, 2011, at 8:39 PM, sveltema wrote:
I came across this bug yesterday when using SA_OAuthTwitterController with an SA_OAuthTwitterEngine that has not finished the OAuthSetup.
In the init method :
- (id) initWithEngine: (SA_OAuthTwitterEngine *) engine andOrientation:(UIInterfaceOrientation)theOrientation { if (self = [super init]) { .... if (!engine.OAuthSetup) [_engine requestRequestToken]; ..... NSURLRequest *request = _engine.authorizeURLRequest; [_webView loadRequest: request]; ..... }
if (!engine.OAuthSetup) the SA_OAuthTwitterEngine requests a token, however before the response can be had from Twitter, _engine.authorizeURLRequest is called. When authorizeURLRequest will then send an authorization request with a nil request token.
Im local version I hacked together a Notification to SA_OAuthTwitterEngine, and a requestToken check if (nil != engine.requestToken) to SA_OAuthTwitterController, so that the SA_OAuthTwitterController will only attempt [_webView loadRequest: request] until after the request token has been returned by Twitter.
I may be missing an initialization step somewhere down the line, but this fix "works for me" for now.
Reply to this email directly or view it on GitHub: https://github.com/bengottlieb/Twitter-OAuth-iPhone/issues/74
Ben Gottlieb iM ben@standalone.com
Hi sveltema, I found this problem too, could you please share your fix code? Thanks a lot!
Andy,
The fix was way too hacky across a couple frameworks, so I switched back to XAuth (I have no need for sending DM). It was a simple hack though. Just add a notification to the request token completion to notify SA_OAuthTwitterController to send the authorizeURLRequest and load the webview.
Hi Sveltema, Thanks a lot!
I may implement it later :)
2011-6-197:24 sveltema д
Andy,
The fix was way too hacky across a couple frameworks, so I switched back to XAuth (I have no need for sending DM). It was a simple hack though. Just add a notification to the request token completion to notify SA_OAuthTwitterController to send the authorizeURLRequest and load the webview.
Reply to this email directly or view it on GitHub: https://github.com/bengottlieb/Twitter-OAuth-iPhone/issues/74#issuecomment-1400250
Best Regards Andy
Hi Sveltema, can you just post the code to copy and paste in the project? This bug is pretty annoying for a lot of people. Thank you
I came across this bug yesterday when using SA_OAuthTwitterController with an SA_OAuthTwitterEngine that has not finished the OAuthSetup.
In the init method :
if (!engine.OAuthSetup) the SA_OAuthTwitterEngine requests a token, however before the response can be had from Twitter, _engine.authorizeURLRequest is called. When authorizeURLRequest will then send an authorization request with a nil request token.
On my local version I hacked together a Notification to SA_OAuthTwitterEngine, and a requestToken check if (nil != engine.requestToken) to SA_OAuthTwitterController, so that the SA_OAuthTwitterController will only attempt [_webView loadRequest: request] until after the request token has been returned by Twitter.
I may be missing an initialization step somewhere down the line, but this fix "works for me" for now.