我能發佈到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檢查我的更新答案 –