其他分享
首页 > 其他分享> > android – 还有另一个地方可以获得google-services.json吗?

android – 还有另一个地方可以获得google-services.json吗?

作者:互联网

我尝试从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

解决方法:

由于网络连接或类似问题,这可能是一个临时问题.

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

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

>创建一个新的空android工作室项目/如果你有一个
项目跳过此步骤.
>使用此link并按照屏幕上的说明为您的应用生成google-services.json.

Enable Google services for your app

>此处的应用程序名称是指Google Developers
Console
中的项目名称.如果您已经设置了Google开发人员控制台
您的Android应用程序的项目,您可以通过下拉列表选择
菜单.如果您还没有创建一个,只需输入一个名称即可
将在您的开发人员控制台中为您创建项目.
>选择项目所需的Google服务即Google Sign
在,Google Cloud Messaging,AdMob等.在我们的案例中,我们刚刚选择了
谷歌登录.
>您将被要求提供SHA-1哈希.按照these steps获得一个.
>单击生成配置文件.在下一个屏幕上,您将看到为您的应用程序下载google-services.json的选项.下载那个,你很高兴.

Download google-services.json

>获得google-services.json后,请按照these steps完成Google登录.

参考

> Start Integrating Google Sign-In into Your Android App,
> Integrating Google Sign-In into Your Android App

标签:android,google-signin
来源: https://codeday.me/bug/20190923/1815373.html