gpt4 book ai didi

iphone - 如何在iOS SDK中获取LinkedIn连接/ friend /联系人?

转载 作者:行者123 更新时间:2023-12-01 16:49:13 25 4
gpt4 key购买 nike

我想从我的LinkedIn个人资料中获取所有 friend 。请给我建议任何教程。

我的代码是:

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:)];

最佳答案

您可以将其用于连接: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:)];

}

关于iphone - 如何在iOS SDK中获取LinkedIn连接/ friend /联系人?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17588428/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com