android - 还有其他地方可以获取 google-services.json 吗?

标签 android google-signin

我尝试点击 the docs 中的 GET A CONFIGURATION FILE 链接, 但是 the resulting page只是加载和加载。这发生在 Firefox 和 Chrome 以及我的手机上。还有其他方法可以获取配置文件吗?

编辑:我在 Chrome 开发控制台中收到这些错误:

Refused to display 'https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…ed%253Dtrue%26cntlbl%3DContinue%2BAdding%2BSign-In%26cntapi%3Dsignin&hl=en' in a frame because it set 'X-Frame-Options' to 'DENY'.
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://console.developers.google.com') does not match the recipient window's origin ('null').(anonymous function) @ script_foot.js:348n.event.dispatch @ jquery.min.js:3r.handle @ jquery.min.js:3

最佳答案

这可能是由于网络连接或类似原因造成的临时问题。

一种解决方案是稍后再试一次。这可能是因为您尝试下载示例项目 (com.google.samples.quickstart.signin) 的 google-services.json

如果您现在想要结果,可以按照步骤将 Google 登录集成到您的应用中。

  1. 创建一个新的空 android studio 项目/如果你有一个现有的 项目跳过这一步。
  2. 使用这个link并按照屏幕上的说明为您的应用生成 google-services.json

Enable Google services for your app

  1. 这里的应用名指的是你在Google Developers Console中的项目名.如果您已经设置了 Google 开发者控制台 您的 android 应用程序的项目,您可以通过下拉菜单选择它 菜单。如果您还没有创建一个,只需输入一个名称,然后 将在您的开发者控制台中为您创建项目。

  2. 选择您的项目所需的 Google 服务,即 Google Sign
    In, Google Cloud Messaging, AdMob 等。在我们的例子中,我们刚刚选择 谷歌登录。

  3. 系统会要求您提供 SHA-1 哈希值。关注 these steps得到一个。

  4. 点击生成配置文件。下一个屏幕将显示为您的应用下载 google-services.json 的选项。下载它,你就可以开始了。

Download google-services.json

  1. 获得 google-services.json 后,请关注 these steps完成 Google 登录。

引用文献

  1. Start Integrating Google Sign-In into Your Android App ,
  2. Integrating Google Sign-In into Your Android App .

关于android - 还有其他地方可以获取 google-services.json 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34367870/

相关文章:

android-widget - Android NumberPicker 如何找到改变的数量?

android - 在 Google Drive App 文件夹中存储房间数据库?

oauth - OAuth 2.0 何时关闭?

iOS Google Sign In SDK webview 签名后不关闭

java - 使用带有 GridLayoutManager 的 RecyclerView 将动态按钮添加到手机和平板电脑的不同布局

android - 在应用安装时添加 Android 小部件

java - Android:将值从 Activity 传递到广播接收器

java - 如何从 Android 设备(如 Google Pay 应用)获取用户名和电子邮件地址

android - Google 登录错误状态 {statusCode=DEVELOPER_ERROR, resolution=null}

ios - 在运行时更改客户端 ID,Google 登录