Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

595
Views
¿Cómo arreglar `El usuario canceló el flujo de inicio de sesión` con Iniciar sesión con Google en iOS?

Estoy integrando Iniciar sesión con Google con iOS Firebase SDK. Cuando un usuario toca el botón GIDSignIn , la aplicación muestra una alerta que muestra "MyAPP" want to use Google.com for Sign in , pero la alerta se descarta rápidamente. El error que obtengo en el didSignInFor user: GIDGoogleUser es el siguiente:

 2019-02-21 16:54:13.104279+0530 MyApp[18743:185089] [Warning] Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<SFAuthenticationViewController: 0x7fa327945800>) [DEBUG] Google sign-in error: Error Domain=com.google.GIDSignIn Code=-5 "The user canceled the sign-in flow." UserInfo={NSLocalizedDescription=The user canceled the sign-in flow.}

He seguido la documentación de Autenticar mediante el inicio de sesión de Google en iOS .

También probé la respuesta en Google Sign-In se bloquea en iOS 9 al intentar llamar a canOpenURL , pero no funciona.

AppDelegate también implementa GIDSignInUIDelegate .

Si cambio el botón de GIDSignInButton a UIButton , funciona, pero se pierde el estilo.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

También enfrenté el problema antes. El objeto GIDSignInButton no necesita addTarget en el código o vincular @IBAction . La clase GIDSignInButton ya maneja esa acción por nosotros.

over 4 years ago · Santiago Trujillo Report

0

Si está intentando ejecutar GIDSignIn.sharedInstance()?.signIn() en @IBAction . Puede ejecutar GIDSignIn.sharedInstance()?.presentingViewController = self justo antes de iniciar sesión en lugar de dentro de viewDidLoad() .

 @IBAction func googleLogin(_ sender: UIButton) { GIDSignIn.sharedInstance()?.presentingViewController = self GIDSignIn.sharedInstance()?.signIn() }
over 4 years ago · Santiago Trujillo Report

0

En Appdelegate intente usar el siguiente código

 func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { let result = GIDSignIn.sharedInstance().handle(url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation]) return result }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!