Iphone 谷歌';s GTMOAuth2Authentication客户端支持授予脱机访问权限?
我正在尝试获取Picasa脱机访问相册和照片的请求令牌。我可以使用这两个参数(access_type和approval_prompt)从服务器端请求它,但我不确定如何将它们传递给iPhone客户端(GTMOAuth2Authentication和GTMOAuth2ViewControllerTouch) 访问\类型=脱机和批准\提示=强制“ 任何帮助都将不胜感激Iphone 谷歌';s GTMOAuth2Authentication客户端支持授予脱机访问权限?,iphone,picasa,Iphone,Picasa,我正在尝试获取Picasa脱机访问相册和照片的请求令牌。我可以使用这两个参数(access_type和approval_prompt)从服务器端请求它,但我不确定如何将它们传递给iPhone客户端(GTMOAuth2Authentication和GTMOAuth2ViewControllerTouch) 访问\类型=脱机和批准\提示=强制“ 任何帮助都将不胜感激 谢谢!找到了答案。在发出请求之前,请在GTMOAuth2SignIn additionalAuthorizationParameter
谢谢!找到了答案。在发出请求之前,请在GTMOAuth2SignIn additionalAuthorizationParameters属性中设置参数
GTMOAuth2ViewControllerTouch *viewController;
[[viewController signIn] setAdditionalAuthorizationParameters:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"offline",@"force", nil] forKeys:[NSArray arrayWithObjects:@"access_type",@"approval_prompt", nil]]];
希望这对你有帮助
你有没有想过?
-(void)showGoogleLoginPage{
SEL finishedSelector = @selector(viewController:finishedWithAuth:error:);
GTMOAuth2ViewControllerTouch *authViewController =
[[GTMOAuth2ViewControllerTouch alloc] initWithScope:kGTLAuthScopeDrive
clientID:kClientID
clientSecret:kClientSecret
keychainItemName:userKeyChainName
delegate:self
finishedSelector:finishedSelector];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjects:[NSArray
arrayWithObjects:@"offline",@"force",@"en", nil] forKeys:[NSArray arrayWithObjects:@"access_type",@"approval_prompt",@"hl", nil]];
authViewController.signIn.shouldFetchGoogleUserProfile = YES;
authViewController.signIn.additionalAuthorizationParameters=params;
[self presentViewController:authViewController animated:YES completion:nil];
}