开发者

IOS : SA_OAuthTwitterController callback after authorization

I m using for the first time the twitter rush exemple to handle posts on twitter , all goes well excepts I want to post the message immedialy after the autorization , and I dont know how to make a callback after autorization

if(!_engine){  
    NSLog(@"init SA_OAuthTwitterEngine");
    _engine = [[[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self] retain];  
    _engine.consumerKey    = kOAuthConsumerKey;  
    _engine.consumerSecret = kOAuthConsumerSecret;  
}   



if(![_engine isAuthorized]){ 

    UIViewController *controller = [SA_OAuthTwitterCon开发者_如何学JAVAtroller controllerToEnterCredentialsWithTwitterEngine:_engine delegate:self];  

    if (controller){  
        [self presentModalViewController: controller animated: YES];  
    }  

}     

Here are the callbacks , but I dont know how to access _engine inside it :

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

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

}

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


Can be done with this delagate:

 #pragma mark SA_OAuthTwitterControllerDelegate


- (void) OAuthTwitterController: (SA_OAuthTwitterController *) controller authenticatedWithUsername: (NSString *) username{


}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜