【问题标题】:How to show google accounts screen after authentication in iOS?如何在 iOS 中进行身份验证后显示谷歌帐户屏幕?
【发布时间】:2019-10-06 13:39:25
【问题描述】:

即使在使用适用于 iOS 的 GoogleSignIn SDK 进行身份验证后,我也需要每次都向用户显示 Google 登录屏幕。

我必须在我的 iOS 应用程序中集成 Google SignIn。为此,我关注了https://developers.google.com/identity/sign-in/ios/start-integrating,通过这个,我能够成功登录。

通过研究我们可以通过附加一个参数作为 {prompt=select_account} 直接调用该 Google OAuth 身份验证 URL 来实现这一点,从而找到了一些输入。此链接How to force account login for a single account user with Google's OAuth 2.0?

但我想通过使用 Google 登录 SDK 来做到这一点。有没有办法做到这一点?

[GIDSignIn sharedInstance].clientID = @"CLIENT_ID";

[GIDSignIn sharedInstance].delegate = self;

 [GIDSignIn sharedInstance].uiDelegate = self;

 [[GIDSignIn sharedInstance] signIn];

【问题讨论】:

    标签: ios swift iphone google-signin


    【解决方案1】:

    技巧是在登录前调用signout,这样你每次都可以显示谷歌登录屏幕。但我认为这不是一个可靠的解决方案。如果您发现任何新内容,请更新。谢谢

    
    GIDSignIn.sharedInstance()?.signOut()
    GIDSignIn.sharedInstance()?.signIn()
    
    

    【讨论】:

      猜你喜欢
      • 2021-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-13
      • 2019-03-20
      • 2022-07-11
      • 1970-01-01
      相关资源
      最近更新 更多