应将捆绑包标识符添加为 URL 方案以启用 Google 登录

The bundle identifier should be added as a URL scheme to enable Google sign-in

我正在尝试将 Google Analytics 和 App Invites 集成到我的 Swift 项目中,并严格遵守此文档:

后面的一个遗漏是必须加上

#import <Google/AppInvite.h>

给你的 bridging header.

此外,我将 GoogleService-Info.plist 中的 REVERSED_CLIENT_ID 连同标识符 Google 添加到 Project -> Target -> Info -> URL Types -> URL Schemes 中,如 Google 登录文档中所述。

但是,在 运行 期间,我收到错误消息`

The bundle identifier should be added as a URL scheme to enable Google sign-in

我在使用 Google "Enable Google services for your app" 网络工具时没有选择 Google 登录,所以这个错误令人困惑和意外。

我该如何解决这个问题?

我尝试在模拟器上测试时遇到了这个错误,但在设备上运行良好。可能只是它在模拟器中不起作用?

我向项目添加了一个与我的 Bundle 标识符相同的 URL 方案。现在可以使用了。

这里 "com.suresh.myApp" 是我的应用程序的包标识符。