Hi I need to send connection request in linkedIn from my app. I refer this link but still I getting error.
1.LinkedIn Integration in iOS: Invitation API not working
My code
To send request by below code
NSURL *url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~/mailbox"];
OAMutableURLRequest *request =
[[OAMutableURLRequest alloc] initWithURL:url
consumer:oAuthLoginView.consumer
token:oAuthLoginView.accessToken
callback:nil
signatureProvider:[[OAHMAC_SHA1SignatureProvider alloc] init]];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSDictionary *temp=[[NSDictionary alloc]initWithObjectsAndKeys:@"/people/email=test@test.com",@"_path",@"Test",@"first-name",@"Testing",@"last-name", nil];
NSDictionary *temp2=[[NSDictionary alloc] initWithObjectsAndKeys:temp,@"person",nil];
NSArray *arr2=[[NSArray alloc]initWithObjects:temp2, nil];
NSDictionary *value=[[NSDictionary alloc]initWithObjectsAndKeys:arr2,@"values", nil];
NSDictionary *dict3=[[NSDictionary alloc]initWithObjectsAndKeys:@"friend",@"connect-type",nil];
NSDictionary *dict4=[[NSDictionary alloc] initWithObjectsAndKeys:dict3,@"invitation-request", nil];
NSDictionary *dict=[[NSDictionary alloc]initWithObjectsAndKeys:dict4,@"item-content",@"Say yes!",@"body",@"Invitation to connect.",@"subject",value,@"recipients", nil];
NSString *updateString = [dict JSONString];
[request setHTTPBodyWithString:updateString];
[request setHTTPMethod:@"POST"];
OADataFetcher *fetcher = [[OADataFetcher alloc] init];
[fetcher fetchDataWithRequest:request
delegate:self
didFinishSelector:@selector(postUpdateApiCallResult1:didFinish:)
didFailSelector:@selector(postUpdateApiCallResult1:didFail:) withPrepare:NO];
OADataFetcher.m
- (void)fetchDataWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector withPrepare:(BOOL)isPrepare
{
[request release];
request = [aRequest retain];
delegate = aDelegate;
didFinishSelector = finishSelector;
didFailSelector = failSelector;
if (isPrepare)
[request prepare];
connection = [[NSURLConnection alloc] initWithRequest:aRequest delegate:self];
}
I getting error below
<error>
<status>401</status>
<timestamp>1399885201227</timestamp>
<request-id>YTU5250BQI</request-id>
<error-code>0</error-code>
<message>Unknown authentication scheme</message>
</error>
oAuthLoginView.m
OARequestParameter *nameParam = [[OARequestParameter alloc] initWithName:@"scope"
value:@"r_fullprofile+r_contactinfo+r_emailaddress+r_network+rw_nus+w_messages"];
NSArray *params = [NSArray arrayWithObjects:nameParam, nil];
[request setParameters:params];
OARequestParameter * scopeParameter=[OARequestParameter requestParameter:@"scope" value:@"r_fullprofile r_contactinfo r_emailaddress r_network rw_nus w_messages"];
These are the previlages I gave. I sharing text and get profile information from linkedIn all working fine but send request not working....