xcode 在 iPhone sdk 中从 LinkedIn 获取用户配置文件数据
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11559518/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Fetching user profile data from LinkedIn in iPhone sdk
提问by user973012
Using IOS, I am trying to integrate the LinkedIn into the application. The integration is also working,user login is also working but the I am not able to fetch the data of user profile with all records of user as Education,Skills and all. I am able to get only these four values after successful login. -first-name -site-standard-profile-request -last-name -headline
使用 IOS,我试图将 LinkedIn 集成到应用程序中。集成也在工作,用户登录也在工作,但我无法获取用户配置文件的数据,其中包含用户的所有记录,如教育、技能等。成功登录后,我只能获得这四个值。-first-name -site-standard-profile-request -last-name -headline
Can anyone please to get all the values rather than these. Thanks in adavance.
任何人都可以获取所有值而不是这些值。提前致谢。
回答by user973012
The question was to get the profile data from LinkedIn after login. The demo application is from https://github.com/ResultsDirect/LinkedIn-iPhone
问题是在登录后从 LinkedIn 获取个人资料数据。演示应用程序来自https://github.com/ResultsDirect/LinkedIn-iPhone
We have to do changes in "-(RDLinkedInConnectionID *)profileForCurrentUser " this function. The function is located at LinkedInClientLibrary -> Classes -> RDLinkedInEngine this location.
我们必须在“-(RDLinkedInConnectionID *)profileForCurrentUser”这个函数中做改变。该函数位于LinkedInClientLibrary -> Classes -> RDLinkedInEngine 这个位置。
We just have to change the below url to get data.
我们只需要更改以下网址即可获取数据。
NSURL* url = [NSURL URLWithString:[kAPIBaseURL stringByAppendingString:@"/v1/people/~/
"]];
To get the user profile data just change the url to:
要获取用户配置文件数据,只需将 url 更改为:
NSURL* url = [NSURL URLWithString:[kAPIBaseURL stringByAppendingString:@"/v1/people/~:(id,first-name,last-name,maiden-name,formatted-name,phonetic-last-name,location:(country:(code)),industry,distance,current-status,current-share,network,skills,phone-numbers,date-of-birth,main-address,positions:(title),educations:(school-name,field-of-study,start-date,end-date,degree,activities))"]];
From this url we can get the data of the profile user.
从这个 url 我们可以获取配置文件用户的数据。
To get more fields from user profile refers these links:
要从用户个人资料中获取更多字段,请参阅以下链接:
https://developer.linkedin.com/documents/field-selectorshttps://developer.linkedin.com/documents/profile-fields
https://developer.linkedin.com/documents/field-selectors https://developer.linkedin.com/documents/profile-fields
To get data according to fields we have to mention the parent of that fields and needed fields from that.This is listed in https://developer.linkedin.com/documents/profile-fieldsthis link.
要根据字段获取数据,我们必须提及该字段的父级和所需的字段。这在https://developer.linkedin.com/documents/profile-fields这个链接中列出。
If we want data from education so we have to mention as
如果我们想要来自教育的数据,那么我们必须提到
educations:(school-name,field-of-study,start-date,end-date,degree,activities)
educations will be the parent and other data in brackets() are its fields which we can get from profile.
教育将是父母,括号()中的其他数据是我们可以从配置文件中获取的字段。
Hope this will work with you also.
希望这也适用于您。
回答by kamalesh kumar yadav
the above explanation given by Micro is correct ant appropriate
Micro给出的上述解释是正确的蚂蚁合适
To get the email id from LinkedIn only change the url
要从 LinkedIn 获取电子邮件 ID,只需更改 url
NSURL *url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~:(id,first-name,last-name,maiden-name,email-address,formatted-name,phonetic-last-name,location:(country:(code)),industry,distance,current-status,current-share,network,skills,phone-numbers,date-of-birth,main-address,positions:(title),educations:(school-name,field-of-study,start-date,end-date,degree,activities))"];
and you will get the email
你会收到电子邮件
or you want more help you can follow the stack overflow link Not able to fetch Linked connections EMAIL ID
或者您需要更多帮助,您可以关注堆栈溢出链接 无法获取链接的连接 EMAIL ID