Hi,
I've been trying this code below and it's giving me a -1001 error like this:
The operation couldn’t be completed. (com.google.GTMOAuth2 error -1001.) ------- Error Domain=com.google.GTMOAuth2 Code=-1001 "The operation couldn’t be completed. (com.google.GTMOAuth2 error -1001.)" UserInfo=0xe9e3ab0 {request=<NSMutableURLRequest: 0xe9ca940> { URL: https://accounts.google.com/o/oauth2/token }}
Would anyone know why it's giving me this generic error ? I check the network and it seems the program is not sending any HTTP requests out.
auth = [GTMOAuth2Authentication authenticationWithServiceProvider:@"Test"
tokenURL:[NSURL URLWithString:@"https://accounts.google.com/o/oauth2/token"]
redirectURI:[NSURL URLWithString:@"http://localhost"]
clientID:client
clientSecret:secret];
auth.scope = @"https://www.googleapis.com/auth/prediction";
NSURL *url = [NSURL URLWithString:@"https://www.googleapis.com/auth/prediction"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[auth authorizeRequest:request completionHandler:^(NSError *error){
if(error) {
NSLog(@"ERROR!!!! %@ ------- %@", [error localizedDescription] , [error debugDescription]);
} else {
NSLog(@"SUCCESS!!!");
}
}];