简体   繁体   English

iOS-使用LinkedIn API从LinkedIn获得兴趣

[英]iOS - Get Interests from LinkedIn using LinkedIn API

Is it possible to get User's Interest from LinkedIn using LinkedIn API. 是否可以使用LinkedIn API从LinkedIn获得用户的兴趣 I can get the user basic details, But i dont know that how to get the Interest list. 我可以获取用户的基本详细信息,但是我不知道如何获取兴趣列表。 I also searched in google, but nothing wll helps me. 我也在google中搜索过,但没有任何帮助。 Any help regarding this will be appreciated. 任何帮助,将不胜感激。 Thanks. 谢谢。

At finally found the answer, It is very simplest one, but it takes these much time to find out, 终于找到答案了,这是最简单的答案,但是要花很多时间才能找出答案,

Just added the interests option in the following url, 刚刚在以下网址中添加了interests选项,

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

OAMutableURLRequest *request =
[[OAMutableURLRequest alloc] initWithURL:url
                                consumer:consumer
                                   token: self.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(profileCancel:didFail:)];

Now using Linkedin sdk developer can easily fetch this kind of data. 现在,使用Linkedin sdk开发人员可以轻松获取此类数据。

NSString *url = @"https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url,public-profile-url,interests)" //NSString *url=@"https://api.linkedin.com/v1/people/~?format=json";

if ([LISDKSessionManager hasValidSession]) {
    [[LISDKAPIHelper sharedInstance] getRequest:url success:^(LISDKAPIResponse *response) {
        DLog(@"Success: %@", response.description);
        DLog(@"response.data: %@", response.data);
        DLog(@"statusCode: %d", response.statusCode);

    } error:^(LISDKAPIError *apiError) {
        DLog(@"Error: %@", apiError.description);
    }];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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