bengottlieb / Twitter-OAuth-iPhone

An easy way to get Twitter authenticating with OAuth on iPhone
http://www.standalone.com
799 stars 155 forks source link

storeCachedTwitterOAuthData not being called #95

Open Hoya opened 12 years ago

Hoya commented 12 years ago

storeCachedTwitterOAuthData doesn't seem to be being called on twitter login. tested on Xcode 4.2.1. with iOS 5.1

crsantos commented 12 years ago

Same issue here

nicolas-miari commented 12 years ago

Same here... trying to find out why/fix it...

nicolas-miari commented 12 years ago

OK, the (optional) delegate method << - twitterOAuthConnectionFailedWithData: >> gets called with the following data as the parameter:

Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x91067f0 {NSErrorFailingURLKey=http://twitter.com/oauth/access_token, NSErrorFailingURLStringKey=http://twitter.com/oauth/access_token, NSUnderlyingError=0x9119cb0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)"}

A google search reveals that "Error -1012" means "NSURLErrorUserCancelledAuthentication" (source: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Constants/Reference/reference.html)

I'll dig deeper to see why this is so...

nicolas-miari commented 12 years ago

OK, sorry for the flood. Found the solution at StackOverflow:

http://stackoverflow.com/questions/7862199/sa-oauthtwitterengine-twitter-authentication-on-ios-5-error-1012

...the solution basically consists of change three lines in -initOAuthWithDelegate:, the three URLs from "http" to "https".

kashiftriffort commented 9 years ago

Thanks for the answer. It really help me a lot.