-1

我正在开发一个 iphone 应用程序,在该应用程序中,我使用 LinkedIn 集成来更新我的状态......但我无法更新我的状态......任何帮助将不胜感激。

提前致谢 Pandu1251

- (IBAction)postButton_TouchUp:(UIButton *)sender

{
[statusTextView resignFirstResponder];

NSURL *url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~/shares"];
OAMutableURLRequest *request = 
[[OAMutableURLRequest alloc] initWithURL:url
                                consumer:oAuthLoginView.consumer
                                   token:oAuthLoginView.accessToken
                                callback:NO
                       signatureProvider:nil];

NSDictionary *update = [[NSDictionary alloc] initWithObjectsAndKeys:
                        [[NSDictionary alloc] 
                         initWithObjectsAndKeys:
                         @"anyone",@"code",nil], @"visibility", 
                        statusTextView.text, @"comment", nil];
 NSLog(@"statusTextView.text is---%@",statusTextView.text);

[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSString *updateString = [update JSONString];

NSLog(@"updateString is---%@",updateString);
[request setHTTPMethod:@"POST"];
[request prepare];
[request setHTTPBodyWithString:updateString];

OADataFetcher *fetcher = [[OADataFetcher alloc] init];
[fetcher fetchDataWithRequest:request
delegate:self
didFinishSelector:@selector(postUpdateApiCallResult:didFinish:)
didFailSelector:@selector(postUpdateApiCallResult:didFail:)];    
[request release];

}

4

1 回答 1

0

首先,您必须检查消费者和访问令牌等参数。

或者你可以在控制台中测试它

https://apigee.com/console/linkedin

你见过这个: http: //www.whitneyland.com/2011/03/iphone-oauth.html

或这个:

https://github.com/ResultsDirect/LinkedIn-iPhone

他们应该可以帮助您开始使用 iOS

于 2012-09-05T07:56:43.867 回答