Google 로그인 빠른 이전 가이드

이 페이지에서는 Google 로그인 SDK 메이저 버전의 주요 변경사항을 자세히 설명합니다.

이 가이드에 따라 앱을 최신 버전의 Google 로그인 SDK로 이전하세요. 이 문서는 항상 최신 버전을 참조합니다.

자세한 내용은 출시 노트 및 GitHub 저장소를 참고하세요.

Google 로그인 SDK v7.0.0 이상

Google 로그인 SDK v7.0.0 이전 버전에서 앱을 이전하려면 다음과 같이 변경하세요.

v6.2.x v7.0.0 이상
GIDSignIn
signInWithConfiguration:presentingViewController:callback:
GIDSignIn
signInWithPresentingViewController:completion:
GIDSignIn
restorePreviousSignInWithCallback:
GIDSignIn
restorePreviousSignInWithCompletion:
GIDSignIn
disconnectWithCallback:
GIDSignIn
disconnectWithCompletion:
GIDAuthentication
doWithFreshTokens:
GIDGoogleUser
refreshTokensIfNeededWithCompletion:
GIDSignIn
addScopes:presentingViewController:callback:
GIDGoogleUser
addScopes:presentingViewController:completion:

Google 로그인 SDK v6.0.0

Google 로그인 SDK v6.0.0 이전 버전에서 앱을 이전하려면 다음과 같이 변경하세요.

  • GIDSignIn.sharedInstance 속성 액세스에 대한 모든 [GIDSignIn sharedInstance] 호출을 업데이트합니다.

  • 모든 클라이언트 구성 (클라이언트 ID 등)을 GIDConfiguration 객체로 이동합니다.

  • 삭제된 메서드 호출을 이에 상응하는 새로운 메서드로 업데이트합니다.

    v5.x.x v6.0.0
    signIn signInWithConfiguration:presentingViewController:callback:
    restorePreviousSignIn restorePreviousSignInWithCallback:
    disconnect disconnectWithCallback:
    getTokensWithHandler: doWithFreshTokens:
    refreshTokensWithHandler: doWithFreshTokens:
  • GIDSignInDelegate 프로토콜 및 해당 메서드에 대한 모든 참조를 삭제합니다.

    • 로직을 signIn:didSignInForUser:withError:에서 signInWithConfiguration:presentingViewController:callback:의 콜백 블록으로 이동합니다.

    • 로직을 signIn:didDisconnectWithUser:withError:에서 disconnectWithCallback:의 콜백 블록으로 이동합니다.

  • IBAction 등을 사용하여 signInWithConfiguration:presentingViewController:callback:를 호출하는 메서드에 GIDSignInButton를 수동으로 연결합니다.