액세스 토큰 취소 및 앱 연결 해제

Google로 로그인한 사용자에게 앱에서 자녀의 Google 계정 연결을 해제할 수 있습니다. 사용자가 앱을 사용하려면 앱에서 수집된 정보를 삭제해야 합니다. Google API

다음 코드 예에서는 프로그래매틱 방식으로 액세스를 취소하는 방법을 보여줍니다. 사용자 대신 앱이 부여된 토큰과 사용자 계정을 삭제할 수 있습니다.

SwiftObjective-C
GIDSignIn.sharedInstance.disconnect { error in
    guard error == nil else { return }

    // Google Account disconnected from your app.
    // Perform clean-up actions, such as deleting data associated with the
    //   disconnected account.
}
[GIDSignIn.sharedInstance disconnectWithCompletion:^(NSError * _Nullable error) {
    if (error) { return; }

    // Google Account disconnected from your app.
    // Perform clean-up actions, such as deleting data associated with the
    //   disconnected account.
}];

disconnectWithCompletion: 메서드는 계정 연결을 해제하고 토큰을 취소합니다. 사용자를 로그아웃시키면 안 됩니다. disconnectWithCompletion:를 호출하기 전에 확인할 수 있습니다.

그러면 콜백 블록 내에서 성공적인 연결 해제에 응답할 수 있습니다. 앱 또는 백엔드 코드에서 적절한 로직을 트리거해야 합니다.