I'm getting NSURLErrorDomain error -1012. error in xcode 6.2 , I'm able to get the access token successfully, I tried reseting simulator.. here is the code
-(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(@"Querying accessToken failed %@", error);
}];
} cancel:^{
NSLog(@"Authorization was cancelled by user");
} failure:^(NSError *error) {
NSLog(@"Authorization failed ::::%@", error.localizedDescription);
}];
}