we are working on sharing with the linkedIn objective C SDK, latest version.
Using this code:
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;
});
}];
}
lifted pretty much from their sample page. (Had to update a bit, the URL on the site was declared with initWithString which is no longer around).
We have requested and receive a valid session and requested the w_share permission as required in the updated spec.
Here is the actual error:
Error Domain=LISDKErrorAPIDomain Code=400 "(null)" UserInfo={LISDKAuthErrorAPIResponse=<LISDKAPIResponse: 0x1288cc100>}
Any hints would be appreciated!