gpt4 book ai didi

ios - 无法提取当前用户该操作无法完成。 (NSURLErrorDomain错误-1012

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

我收到NSURLErrorDomain错误-1012。 xcode 6.2中的错误,我能够成功获取访问 token ,我尝试重置模拟器..这是代码

-(void)getLinkedInData:(LIALinkedInHttpClient*)client
{
[client getAuthorizationCode:^(NSString *code) {
[client getAccessToken:code success:^(NSDictionary *accessTokenData) {
NSLog(@"Access token data: %@",accessTokenData);
NSString *accessToken = [accessTokenData objectForKey:@"access_token"];
NSLog(@"Access token: %@",accessToken);
[client GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~?oauth2_access_token=%@&format=json", accessToken] parameters:nil success:^(AFHTTPRequestOperation *operation, NSDictionary *result) {
NSLog(@"current user %@", result);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"failed to fetch current user %@", error.localizedDescription);
}];
} failure:^(NSError *error) {
NSLog(@"Quering accessToken failed %@", error);
}];
} cancel:^{
NSLog(@"Authorization was cancelled by user");
} failure:^(NSError *error) {
NSLog(@"Authorization failed ::::%@", error.localizedDescription);
}];
}

最佳答案

我不确定这是否会回答您的问题,但是我发现,当同步调用Web服务并返回401“未授权”错误时,iOS将仅返回模糊的-1012错误。

iOS: How can i receive HTTP 401 instead of -1012 NSURLErrorUserCancelledAuthentication

因此,尝试检查您是否遇到身份验证问题,然后从那里解决问题。

关于ios - 无法提取当前用户该操作无法完成。 (NSURLErrorDomain错误-1012,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29694092/

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