Ios5 通过iphone应用程序更新linkedin中的状态

Ios5 通过iphone应用程序更新linkedin中的状态,ios5,linkedin,Ios5,Linkedin,这是我目前的代码: -(IBAction)postToLinkedin{ rdEngine = [RDLinkedInEngine engineWithConsumerKey:LI_kOAuthConsumerKey consumerSecret:LI_kOAuthConsumerSecret delegate:self] ; RDLinkedInAuthorizationController* controller = [RDLinkedInAuthorizationCon

这是我目前的代码:

-(IBAction)postToLinkedin{   
   rdEngine = [RDLinkedInEngine engineWithConsumerKey:LI_kOAuthConsumerKey consumerSecret:LI_kOAuthConsumerSecret delegate:self] ; 
   RDLinkedInAuthorizationController* controller = [RDLinkedInAuthorizationController authorizationControllerWithEngine:rdEngine delegate:self];
   if( controller) { 
        [self presentModalViewController:controller animated:YES];
        }
   else   
       {
       NSLog(@"alreadyy authenticated");       
       }
 }

-(void)linkedInEngineAccessToken:(RDLinkedInEngine *)engine setAccessToken:(OAToken *)token {
    NSLog(@"1111111");
    [token storeInUserDefaultsWithServiceProviderName:@"LinkedIn" prefix:@"Demo"];    
    }

- (void)linkedInEngineAccessToken:(RDLinkedInEngine *)engine removeAccessToken:(OAToken *)token {
    [token removeAccessTokenUsingServiceProviderName:@"LinkedIn" prefix:@"Demo"];
    }

- (OAToken *)linkedInEngineAccessToken:(RDLinkedInEngine *)engine {    
    return [[OAToken alloc] initWithUserDefaultsUsingServiceProviderName:@"LinkedIn" prefix:@"Demo"] ;
    NSLog(@"3333");
    }

- (void)linkedInEngine:(RDLinkedInEngine *)engine requestSucceeded:(RDLinkedInConnectionID *)identifier withResults:(id)results {
    NSLog(@"++ LinkedIn engine reports success for connection %@\n%@", identifier, results);
   UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Success" message:@"Successfully Tweeted" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
    [alert show];
    }

- (void)linkedInEngine:(RDLinkedInEngine *)engine requestFailed:(RDLinkedInConnectionID *)identifier withError:(NSError *)error {
    NSLog(@"++ LinkedIn engine reports failure for connection %@\n%@", identifier, [error localizedDescription]);
    }

//#pragma mark -
//#pragma mark RDLinkedInAuthorizationControllerDelegate

- (void)linkedInAuthorizationControllerSucceeded:(RDLinkedInAuthorizationController *)controller {
    NSLog(@"Authentication succeeded.");
    NSLog(@"Fetching current user's profile on connection %@", [controller.engine profileForCurrentUser]); 
    [rdEngine updateStatus:@"hello"];
    }

- (void)linkedInAuthorizationControllerFailed:(RDLinkedInAuthorizationController *)controller {
    NSLog(@"Authentication failed!");
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Error occurred while updating Linkedin status." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
    [alert show]; 
    }

- (void)linkedInAuthorizationControllerCanceled:(RDLinkedInAuthorizationController *)controller {
    NSLog(@"Authentication was cancelled.");
    }
代码不工作,因为状态未更新。
您能告诉我哪里出了问题吗?

为什么要在
postToLinkedIn
中显示授权控制器? 您可能需要在此处查看共享API