J'essaie d'obtenir un contact Google en utilisant Google contact api.Comment obtenir des contacts google de google contact api?
Je reçois toutes les authentifications de google mais je ne sais pas comment appeler google contact api. Je l'ai fait déjà:
NSLog(@"\n\n User Access Token : %@",user.authentication.accessToken);
NSLog(@"\n\n User Refresh Token : %@",user.authentication.refreshToken);
NSLog(@"\n\n Person Token Expire Date : %@",user.authentication.accessTokenExpirationDate);
NSLog(@"\n\n Person Client ID : %@",user.authentication.clientID);
Je suis en train de code suivant pour appeler le contact api mais obtenir une réponse inattendue:
Réponse: Fin prématurée du fichier.
NSString * urlString = [NSString stringWithFormat:@"https://www.google.com/m8/feeds/contacts/default/full/"];
urlString =[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
timeoutInterval:60.0];
//do post request for parameter passing
[theRequest setHTTPMethod:@"POST"];
[theRequest setValue:@"application/atom+xml" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue:[NSString stringWithFormat:@"Bearer %@",user.authentication.accessToken] forHTTPHeaderField:@"Authorization"];
[theRequest addValue:@"3.0" forHTTPHeaderField:@"GData-Version"];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
ici je reçois le contact mais comment obtenir dans mon application.
merci à l'avance.
s'il vous plaît donnez-moi le code source parfait. Je ne peux pas trouver 'self.auth'. @ Mr.Rebot – Application
Où puis-je trouver 'authorizeRequest'? @ Mr.Rebot – Application