2014-04-02 2 views
2

Google+를 사용하여 Google+ SDK를 사용하여 앱에 로그인합니다. 사용자가 로그인 페이지로 리디렉션되고 cancel 버튼을 두드리면 아래 오류가 발생합니다. iOS : 사용자가 Google+ 로그인을 취소했는지 확인하는 방법

Error Domain=com.google.GooglePlusPlatform Code=-1 "Unknown error" UserInfo=0xd5e37b0 {NSLocalizedDescription=Unknown error}, 

Code

그들은 NSError에 사용자가 로그인이나 다른 오류를 취소 이벤트를 구별 할 수 없습니다 설정합니다. 다른 오류는 같은 Code이 사용 되었기 때문에. 아래는 그 예입니다.

Error Domain=com.google.GooglePlusPlatform Code=-1 "Mismatched authentication" UserInfo=0xd5968e0 {NSLocalizedDescription=Mismatched authentication}, 

오류 메시지를 확인하는 것은 신뢰할 수있는 방법은 아닙니다.

그런 다음 어떻게 확인하나요?

답변

-2

오류가 발생하면 로그 아웃하십시오.

-(void)finishedWithAuth: (GTMOAuth2Authentication *)auth 
         error: (NSError *) error { 

     if (error) { 

     // use nslog to get the exact error 

     // make sure you do this in case of error, sign out the user. 

     [[GPPSignIn sharedInstance] signOut]; 

     } else { 
     GPPSignIn *signIn = [GPPSignIn sharedInstance]; 
     NSLog(@"User ID:%@", signIn.userID); 
     NSLog(@"User Email:%@", signIn.userEmail); 

    } 

} 
관련 문제