ios - Google 登录在 iOS 中不起作用 - 无效的 GOOGLE_APP_ID 错误

标签 ios objective-c iphone google-signin

我在 iOS 应用程序中使用谷歌登录,但显示错误。

我使用 Cocoapods 添加 sdk 。当我在项目中进行所有设置并启动应用程序时

The GOOGLE_APP_ID either in the plist file 'GoogleService-Info.plist' or the one set in the customized options is invalid. If you are using the plist file, use the iOS version of bundle identifier to download the file, and do not manually edit the GOOGLE_APP_ID. You may change your app's bundle identifier to '(null)'. Or you can download a new configuration file that matches your bundle identifier from https://console.firebase.google.com/ and replace the current one.

我正确添加的所有东西都不知道为什么它不起作用。在它起作用之前我已经更新了我的 pod 文件以获取最新的 google sign sdk。

我的 pod 文件有 pod 'Google/SignIn' 当我安装 pod 时(pod 有)它已添加

Installing FirebaseAnalytics (3.2.0) 
Installing FirebaseInstanceID (1.0.6) 

即使我没有添加任何与 Firebase 相关的内容,我也不知道为什么会出现这种情况。

这是我的 分析依赖关系 下载依赖

Installing FirebaseAnalytics (3.2.0)
Installing FirebaseInstanceID (1.0.6)
Installing Google (3.0.3)
Installing GoogleAppUtilities (1.1.1)
Installing GoogleAuthUtilities (2.0.1)
Installing GoogleInterchangeUtilities (1.2.1)
Installing GoogleNetworkingUtilities (1.2.1)
Installing GoogleSignIn (4.0.0)
Installing GoogleSymbolUtilities (1.1.1)
Installing GoogleUtilities (1.3.1)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `googletest.xcworkspace` for this project from now on.
Sending stats

为什么要安装 Firebase 依赖项和 google sign

如何解决这个问题。

最佳答案

我已经能够通过以下方式解决此问题:

  • 打开https://developers.google.com/mobile/add
  • 选择平台:iOS 应用
  • 应用名称:从下拉菜单中选择现有应用
  • iOS Bundle ID:从下拉菜单中选择现有的 bundle ID
  • 继续并配置服务
  • 确保 Google SignIn 上有绿色复选标记
  • 生成配置文件
  • 下载plist

下载的 plist 与我之前的 CLIENT_IDREVERSED_CLIENT_IDBUNDLE_ID 具有完全相同的值,但它添加了一些键包括 GOOGLE_APP_ID

我用这个新文件替换了 Xcode 项目中的 plist 文件,一切恢复正常。

关于ios - Google 登录在 iOS 中不起作用 - 无效的 GOOGLE_APP_ID 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37562551/

相关文章:

html - 在iPhone中,键盘弹出时光标会停留在原来的位置

ios - 重置导航栏

objective-c - 透明 NSWindow 但具有标准边框和阴影

iphone - 设计一个使用 2 个 Restful Web 服务的应用程序

objective-c - 为什么我的iPhone不振动?

ios - 检测 ViewController ios 中哪个场景已启动

iphone - 如何自定义核心图来模仿这种风格?

ios - Offcanvas 菜单 - CSS 过渡不适用于 iphone 3 和 4

ios - React Native TextInput 两个 textContentType、emailAddress 和 username

ios - 使用 Alamofire 在主体中使用简单字符串的 POST 请求