首页 > 解决方案 > How do I implement Google sign-in on iOS app?

问题描述

I've been tasked with adding a "Sign In with Google" button to an iOS app. For background, I'm a contract developer doing work for a customer, and I do not own the app in question.

I did a quick search for how to do this, but the only answer I could find involved "set up a project in the Google API console" followed by "add a GIDSignInButton to your layout".

I do not have access to the app owner's Google Developer account (or know if they even have one), and I certainly do not want to "set up a project" in my own Google account that is associated with a customer's app.

Furthermore, the iOS project I'm working with does not currently have any third-party library integrations (no Swift packages, no CocoaPods, no workspace file) and I strongly prefer to keep it this way.

Is it possible to do Google authentication using a standard OAuth process (i.e. open a web page, and handle the redirect after authentication completes)? I have done other OAuth integrations this way so I know how it works.

Thanks, Frank

标签: oauthgoogle-signin

解决方案


是的,您可以使用 OAuth 登录,而无需使用 SDK。以下是说明

您将需要设置一个项目并配置它的 OAuth 设置。这将管理您的应用在用户面前的显示方式并实施 OAuth 安全控制。没有办法解决这个问题,因此您需要与您的 Google Cloud 管理员合作以获得对现有项目的访问权限或创建一个新项目。


推荐阅读