我正在开发一个 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];
}