i am developing an iphone app, In that app i am using LinkedIn Integration For Updating My status…But I’am unable to Update My Status..Any Help will be Appreciated.
Thanks In Advance
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];
}
first you have to check for the parameters like consumer and access token etc.
or you can test it in console
https://apigee.com/console/linkedin
Have you seen this: http://www.whitneyland.com/2011/03/iphone-oauth.html
or this:
https://github.com/ResultsDirect/LinkedIn-iPhone
They should help you get started on iOS