简体   繁体   中英

Including twitter+Oauth in iOS 4.0 giving a HTTP error

In my iPhone app (targeting iOS 4.0) I need to integrate Twitter. I have used twitter + OAuth and I am able to successfully post once.

After that it is giving me the following error:

F622CF31-9D3F-4FAF-AE0A-50914C1FD0EF failed with error: Error Domain=HTTP Code=403 
"The operation couldn’t be completed. (HTTP error 403.

Here is my simple Twitter code with delegate methods.

Button click code:

if(![_engine isAuthorized]){  
            UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine:_engine delegate:self];  

            if (controller){  
                [self presentModalViewController:controller animated:YES];
                }  
        } 
        else
        {
               [_engine sendUpdate:@"Hello"];
        }

Delegate Methods:

- (void)storeCachedTwitterOAuthData:(NSString *)data forUsername:(NSString *)username {  
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];  

    [defaults setObject:data forKey:@"authData"];  
    [defaults synchronize];  
}  

- (NSString *) cachedTwitterOAuthDataForUsername: (NSString *) username {  
    return [[NSUserDefaults standardUserDefaults] objectForKey: @"authData"];  
}  

Is there any thing I need to modify to extend OAuth permissions?

I have found the answer here.

https://github.com/bengottlieb/Twitter-OAuth-iPhone/issues/26

This link says that you can not post same tweet twice that what the twitter has denied. So take care.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM