我能发布到LinkedIn的评论,但无法发布image
。这是发表评论的代码:如何在iOS上使用Objective-C代码将图像发布到LinkedIn帐户?
NSURL *url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~/shares"];
OAMutableURLRequest *request =
[[OAMutableURLRequest alloc] initWithURL:url
consumer:self.consumer
token:self.accessToken
callback:nil
signatureProvider:nil];
NSString *postedStr = self.textView.text;
NSDictionary *update = [[NSDictionary alloc] initWithObjectsAndKeys:
[[NSDictionary alloc]
initWithObjectsAndKeys:
@"anyone",@"code",nil], @"visibility",
postedStr, @"comment", nil];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSString *updateString = [update JSONString];
[request setHTTPBodyWithString:updateString];
[request setHTTPMethod:@"POST"];
OADataFetcher *fetcher = [[OADataFetcher alloc] init];
[fetcher fetchDataWithRequest:request
delegate:self
didFinishSelector:@selector(postUpdateApiCallResult:didFinish:)
didFailSelector:@selector(postUpdateApiCallResult:didFail:)];
// [self.view addSubview:linkedinView];
[request release];
任何建议真的感激!
@NitinGohel请帮我换LinkedIn。 –
@Nitin Gohel:在此代码中,您使用submittedUrl表示我们需要在任何地方提交图像。我需要在LinkedIn上分享我的本地图片,可以帮助我吗? – TamilKing
@TamilKing检查我的更新答案 –