我们正在与linkedIn客户C SDK,最新版本共享。LinkedIn Objective C分享
使用此代码:
NSString *url = @"https://api.linkedin.com/v1/people/~/shares";
NSString *payload = @"{\"visibility\":[{\"code\":\"anyone\"}],\"comment\":\"Check out developer.linkedin.com! http://linkd.in/1FC2PyG\"}";
if ([LISDKSessionManager hasValidSession]) {
[[LISDKAPIHelper sharedInstance] postRequest:url stringBody:payload success:^(LISDKAPIResponse *response) {
// do something with response
NSLog(@"Success: %@", response.description);
dispatch_async(dispatch_get_main_queue(), ^{
_responseLabel.text = response.description;
});
} error:^(LISDKAPIError *apiError) {
// do something with error
NSLog(@"Error: %@", apiError.description);
dispatch_async(dispatch_get_main_queue(), ^{
_responseLabel.text = apiError.description;
});
}];
}
抬离他们的样品页漂亮多了。 (不得不更新一下,网站上的URL是用initWithString声明的,它已经不在了)。
我们已经请求并接收到有效的会话,并根据更新后的规范要求提供w_share许可。
下面是实际的错误:
Error Domain=LISDKErrorAPIDomain Code=400 "(null)" UserInfo={LISDKAuthErrorAPIResponse=<LISDKAPIResponse: 0x1288cc100>}
任何提示,将不胜感激!
我会放一个断点,看看错误的userInfo。有一个关键(LISDKAuthErrorAPIResponse),可能有一个有趣的对象与更多的信息。 –