- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在我的 iOS 应用中使用 Google 登录。我遵循了 Google 教程 ( https://developers.google.com/identity/sign-in/ios/sign-in#add_the_sign-in_button ),该教程使用用户必须单击的 GIDSignInButton。当他点击它时,他被重定向到 Safari,如下所示:
问题在于我有多个 Google 帐户,并且希望能够选择我想使用的帐户。现在它只是自动接受其中之一,我所要做的就是按“拒绝”或“允许”。此外,我不喜欢应用程序被重定向到 Chrome 的事实。理想情况下,我想要的是类似于 iOS 上的 Google Hangouts 应用程序的功能:
它会显示您之前用于登录任何 Google 应用程序的所有帐户,并让您在不离开应用程序的情况下决定将哪些帐户用于该应用程序。在 Android 上,我的应用程序有类似的功能:
如何在我的 iOS 应用中实现这种行为(不要离开应用 + 帐户选择器)?
最佳答案
他们之所以能够在 Google Hangouts 中做到这一点,是因为它是由 Google 制作的。公司并不总是向开发人员提供所有功能,这就是一个很好的例子。您能够在 android 中执行此操作的原因是因为 Google 决定允许开发人员更多地访问不同的功能。毕竟android是谷歌开发的。现在至于不离开应用程序,您始终可以使用嵌入式 Web View 。这将使用户留在应用程序中,而不是模态地弹出一个 WebView 。它不是世界上最好的,但比将用户发送到其他地方要好。您是否尝试过此代码:
// Implement these methods only if the GIDSignInUIDelegate is not a subclass of
// UIViewController.
// Stop the UIActivityIndicatorView animation that was started when the user
// pressed the Sign In button
func signInWillDispatch(signIn: GIDSignIn!, error: NSError!) {
myActivityIndicator.stopAnimating()
}
// Present a view that prompts the user to sign in with Google
func signIn(signIn: GIDSignIn!,
presentViewController viewController: UIViewController!) {
self.presentViewController(viewController, animated: true, completion: nil)
}
// Dismiss the "Sign in with Google" view
func signIn(signIn: GIDSignIn!,
dismissViewController viewController: UIViewController!) {
self.dismissViewControllerAnimated(true, completion: nil)
}
我在您发布的链接上找到了这个。我没有运行或测试代码,但它似乎显示了一个 View Controller ,而不是将您发送到 safari。这可能更符合您的要求。
回答@Sam 的问题:
“如何通过现有已安装的 Google 应用程序而不是在 Safari 中打开 URL 来登录 Google?”
您可能可以使用 Android 来完成此操作,但不能使用 iOS。这是由于所选平台而受到限制的另一个示例。
请记住,无论您最终选择什么选项,您仍然需要遵守 OAuth 2.0。如果可能的话,我会建议使用谷歌为 iOS 开发者构建的东西。在选择与默认帐户不同的帐户时,如果您选择遵循指南并执行 Google 为 iOS 开发人员创建的内容,那么您只需点击个人资料图片并切换帐户即可。
长话短说
https://www.youtube.com/watch?time_continue=227&v=-26DGO_E1ds
关于android - Google 登录 iOS 帐户选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36452773/
2 个不同的租户(租户 A 中的订阅 A 和租户 B 中的订阅 B) 我们在 Azure 云中有一个订阅,并且我们已经设置了 Azure Keyvault。我们可以在那里创建 key 并使用其中一个
账户-B: 在具有 4 个安全组的 vpc(vpc-B) 中包含 RDS。 我为账户 A 创建了承担角色 具有以下政策: [![在此处输入图像描述][1]][1] [![在此处输入图像描述][2]][
我想问一下如果我使用 Google Apps 帐户而不是 Google 帐户 users.create_login_url() 函数来生成登录页面。 Google 会自动要求我使用 Google 帐户
我正在使用帐户 (accounts-hithub)。现在工作正常,但现在我想更新当前用户。 我尝试过类似的事情 Accounts.update({_id: Meteor.user()._id}, {.
ngrok 的配置文件只允许一个 authtoken 行,您作为用户可用的所有资源(例如,保留的主机名)都基于关联的帐户使用授权 token 。 如果您有多个 ngrok 帐户——例如,一个专业(工作
作为 Coursera 数据科学家类(class)设置的一部分,我错误地将目录 test-repo 链接到错误的帐户。所以,在声明中: git remote add origin https://gi
我想使用 Keycloak 设置 Google 联盟,但仅限于我公司的授权用户。 设置 Google 联盟允许任何 Google 帐户登录。 我查看了 Keycloak 上的身份验证流程,但一直找不到
我正在使用 web3 制作自己的桌面 BSC 钱包。目前我正在使用 private_key = "private key" account = w3.eth.account.privateKeyToA
我们的 Subversion 存储库和 Phabricator 安装有不同的身份验证系统。 但似乎 Phabricator 假定提交作者和 Phabricator 帐户将相同。文档中没有提到提交作者如
我正在使用 codio.com 。从那里我使用 ubuntu 终端登录 Heroku,但它给了我以下错误。我已阅读帮助 page还 。它说使用 MFA 您必须使用浏览器进行登录。但问题是浏览器没有从
我正在尝试第一次发布我的应用程序。如果我没记错的话,为了把admob 广告放到我的应用程序中,我应该有一个admob 帐户。 我的问题是我是否需要使用与打开 Play 商店开发者帐户相同的 gmail
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 3年前关闭。 Improve thi
OS: Ubuntu 18.04 Server Docker 18.3 CE 我使用 PuTTY SSH session 从我的 Windows 10 笔记本电脑登录到服务器。 我的本地 Window
在 Heroku CLI(我使用 WSL/Ubuntu)中,我想查看我当前登录的是哪个 Heroku 帐户。 命令 heroku login开始一个新的登录 session ,但我想知道哪个帐户当前处
除了 [sa] 用户,我在 sysadmin 中没有用户 不幸的是,我以 [sa] 用户身份登录并禁用了它 那么我无法启用它,我该怎么做才能再次启用它? 最佳答案 您必须使用 sqlcmd.exe与
我想找到所有具有索引或已注册身份的 polkadot 帐户;类似于 https://polkascan.io/polkadot/account/identities和 https://polkasca
我想从我的服务器应用程序访问类记录。 我创建了一个服务帐户,但无法从我的 Google 帐户创建的教室中获取记录。 我如何获得访问权限?谢谢 最佳答案 创建服务帐户是不够的。您还必须执行域范围的委派并
我有相同的超链接: HyperLink skype = new HyperLink(); skype.NavigateUrl = "skype:username?call"; 当用户按下它时,他重定向
我和这里的一些人正在创业。我们目前正在使用 Google OpenID API 来管理注册和登录我们的应用程序,但我们希望迁移到更简单的用户注册模型。为此,我们需要知道是否有办法检测电子邮件(不是 g
尝试访问我的 sitemap.xml 时,我收到此错误: 'Account' object has no attribute 'get_absolute_url' on line 112. 109.
我是一名优秀的程序员,十分优秀!