简体   繁体   中英

getting list of the group for specific user in LinkedIn via iPhone SDK

I have integrated linkedIn in my iPhone and I am able to post status on linkedIn. But, is there any way that will give me list of groups that user is following and then interact with group. I have gone through this , but could not figure out how to use this properly.

i have tried using: http://api.linkedin.com/v1/groups/{group-id}/posts But here the problem is that how I will get group-ID.

Any idea would be appreciated. Thnx in advance.

After much wrangling with the Linkedin API Beast, I found the issue to be in the way things are encoded, a long story, in OAuthLoginView.m in method 'requestTokenFromProvider' I needed to include the param 'scope' with the relevant permissions in a OARequestParameter object.

(based off the github repo -> https://github.com/synedra/LinkedIn-OAuth-Sample-Client )

After that, wherever you're making your api call, (in OAuthStarterKit for example) like in ProfileTabView::profileApiCall you can fire off URL posts like this: using: http://api.linkedin.com/v1/group-memberships ; or if you need their email address, it appears (as long as you've got permission to access email, you can grab that too as simply as this:

NSURL *url = [NSURL URLWithString:@" http://api.linkedin.com/v1/people/~:(id,first-name,last-name,industry,email-address) "];

See the code for using a OARequestParameter in the URL request below...

- (void)requestTokenFromProvider
{
    OAMutableURLRequest *request = 
            [[[OAMutableURLRequest alloc] initWithURL:requestTokenURL
                                             consumer:self.consumer
                                                token:nil   
                                             callback:linkedInCallbackURL
                                    signatureProvider:nil] autorelease];

    [request setHTTPMethod:@"POST"];

    OARequestParameter * scopeParameter=[OARequestParameter requestParameter:@"scope" value:@"r_fullprofile r_contactinfo r_emailaddress"];

    [request setParameters:[NSArray arrayWithObject:scopeParameter]];

    OADataFetcher *fetcher = [[[OADataFetcher alloc] init] autorelease];
    [fetcher fetchDataWithRequest:request
                         delegate:self
                didFinishSelector:@selector(requestTokenResult:didFinish:)
                  didFailSelector:@selector(requestTokenResult:didFail:)];    
}

Hope this answer will help a lot of developers looking for Linkedin Integration in iPhone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM