私のアプリケーションでは、Googleアカウントへのアクセスを実装しようとしましたが、初期化するとログインセッションまで機能します。その後、スクリーンショットで次のエラーがスローされます
ここで私のコードの 初期化とメソッドの実装
static NSString *const kKeychainItemName =nil;
NSString *kMyClientID = @"465568347336.apps.googleusercontent.com";
NSString *kMyClientSecret = @"rKVsWXTlo3M8zqNfofkX0Xrl";
NSString *scope = @"https://www.googleapis.com/auth/userinfo.profile";
GTMOAuth2ViewControllerTouch *viewController;
viewController = [[GTMOAuth2ViewControllerTouch alloc] initWithScope:scope
clientID:kMyClientID
clientSecret:kMyClientSecret
keychainItemName:kKeychainItemName
delegate:self finishedSelector:@selector(viewController:finishedWithAuth:error:)];
[self.navigationController presentModalViewController:viewController animated:YES];
エラーハンドラ
- (void)viewController:(GTMOAuth2ViewControllerTouch *)viewController
finishedWithAuth:(GTMOAuth2Authentication *)auth
error:(NSError *)error {
if (error != nil) {
NSString *output=nil;
output = [error description];
NSLog(@"output:%@",output);
UIAlertView *fail = [[UIAlertView alloc] initWithTitle:@"Alert"
message:[NSString stringWithFormat:@"Error, Authentication failed!\n %@",error]
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Try again", nil];
fail.tag = 1;
[fail show];
NSLog(@"Authentication failed!");
} else {
UIAlertView *success = [[UIAlertView alloc] initWithTitle:@"Alert"
message:[NSString stringWithFormat:@"Authentication succeeded!"]
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
success.tag = 2;
[success show];
NSLog(@"Autzentication succeeded!");
}
これを解決する方法は問題です。解決するのを手伝ってください