Reputation: 376
I am using MGTwitterEngine" to Integrate twitter in my app.It works fine up to iOS 4.2 . When I try to access twitter from any of the iOS 5 device , I am experiencing an authentication token issue.
This page is no longer valid. It looks like someone already used the token information you provided. Please return to the site that sent you to this page and try again ... it was probably an honest mistake
After a lot of googling I found some suggestions .But they didn't solve my issue. Tried https instead http .
Upvotes: 2
Views: 3035
Reputation:
I tried all of the above solutions, but these were not able to fix this issue. Finally I did this:
requestRequestToken set new request token
[engine requestRequestToken];// added this to remove the old request token because old request token will not work with new authentication request
UIViewController *controller = [[SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine:engine delegate:self] retain];
[delegate presentModalViewController: controller animated: YES];
Note: It increases the time of loading a web view.
I think it will help.
Upvotes: 2
Reputation: 2719
Try replacing
Request token URL
Authorize URL
Access token URL
I this this should work.
Upvotes: 9
Reputation: 742
I solve this problem detecting iOS version in order to use MGTwitterEngine for iOS 4.3 and earlier version and TWRequest and Twitter API for iOS5.
NSString *requiredVersion = @"5.";
NSRange aRange = [[[UIDevice currentDevice] systemVersion] rangeOfString:requiredVersion];
if (aRange.location == NSNotFound )
{
//MGTwitterEngine here
} else {
//Twitter API here
}
This works for me, I hope it will do it for you.
Upvotes: 2