I m implementing facebook & twitter share using sharekit in iphone app. Facebook share is working fine but twitter share gives error "could not authenticate OAuth".
Asked
Active
Viewed 2,403 times
1 Answers
14
I was having the same problem - this fixed it:
https://github.com/ideashower/ShareKit/issues/229
Summary:
Change SHKTwitter.m in lines 54-56 from
https://twitter.com/
to
https://api.twitter.com/
like this:
self.authorizeURL = [NSURL URLWithString:@"https://api.twitter.com/oauth/authorize"];
self.requestURL = [NSURL URLWithString:@"https://api.twitter.com/oauth/request_token"];
self.accessURL = [NSURL URLWithString:@"https://api.twitter.com/oauth/access_token"];
and in line 323, from http to https:
OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://api.twitter.com/1/statuses/update.json"]
consumer:consumer
token:accessToken
realm:nil
signatureProvider:nil];`

jephers
- 157
- 1
- 6
-
Hi Jephers, Thanks. hi all , line 323 is VERY important. I overlooked it, and that was one whole day wasted on debugging the problem. Just an "s"... – Cullen SUN Jan 09 '12 at 04:59
-
Please note that it's smart to call [SHKTwitter logout] as well since you will get login errors when switching (if you are switching from xauth to oauth that is) – Magnus Apr 26 '12 at 08:51