iphone - How to fetch LinkedIn connections/Friends/Contacts in iOS SDK? -


i want fetch friends linkedin profile. please suggest me tutorial.

my code :

nsurl *url = [nsurl urlwithstring:@"http://api.linkedin.com/v1/people/~/connections:(id,first-name,last-name,email-address,picture-url,positions)"]; oamutableurlrequest *request = [[oamutableurlrequest alloc] initwithurl:url                                                                consumer:self.oauthloginview.consumer                                                                   token:self.oauthloginview.accesstoken                                                                callback:nil                                                       signatureprovider:nil];  [request setvalue:@"json" forhttpheaderfield:@"x-li-format"];  oadatafetcher *fetcher = [[oadatafetcher alloc] init]; [fetcher fetchdatawithrequest:request                      delegate:self             didfinishselector:@selector(profileapicallresult:didfinish:)               didfailselector:@selector(profileapicallresult:didfail:)]; 

you can use connections:for request part see this.

- (void)connectionsapicallresult:(loaserviceticket *)ticket didfinish:(nsdata *)data     {         nsstring *responsebody = [[nsstring alloc] initwithdata:data                                                        encoding:nsutf8stringencoding];          nslog(@"connectionsapicallresult====%@",responsebody);          [responsebody release];     }      - (void)connectionsapicallresult:(loaserviceticket *)ticket didfail:(nserror *)error     {         nslog(@"%@",[error description]);      }      -(void)getconnectionscall     {         nsurl *url = [nsurl urlwithstring:@"http://api.linkedin.com/v1/people/~/connections:(headline,first-name,last-name,picture-url,id)"];          loamutableurlrequest *request =         [[loamutableurlrequest alloc] initwithurl:url                                         consumer:self.consumer                                            token:testaccesstoken                                         callback:nil                                signatureprovider:nil];          [request setvalue:@"json" forhttpheaderfield:@"x-li-format"];          loadatafetcher *fetcher = [[[loadatafetcher alloc] init] autorelease];         [fetcher fetchdatawithrequest:request                              delegate:self                     didfinishselector:@selector(requesttokenresult:didfinish:)                       didfailselector:@selector(requesttokenresult:didfail:)];      } 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -