适用于多个服务器环境的Android版Google登录? [英] Google Sign-in for Android app on multiple server environments?

查看:65
本文介绍了适用于多个服务器环境的Android版Google登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有多个服务器环境(例如,开发,登台,发布),每个服务器环境都在Google Developer Console中作为自己的项目,并且希望能够通过我们的Android应用登录其中任何一个,以进行测试.

We've got multiple server environments (e.g. development, staging, release), each as their own project in Google Developer Console, and want to be able to sign in to any of these from our Android app, for testing purposes.

我可以在其中一种环境下使用Google登录(按照教程此处时,出现以下错误:

I got Google sign-in for one of the environments working (following the tutorial here) but when I try to enable the others here, I get the following error:

The SHA-1 you specified is already used with the same package name for a different Android OAuth2 client.

似乎不允许我们为多个项目的相同软件包名称/签名证书哈希启用Google登录.那么,如何在每个服务器环境中为我们的应用启用Google登录?有办法解决吗?

It seems like we're not allowed to enable Google sign-in for the same packagename/signing certificate hash with multiple projects. So how can I enable Google sign-in for our app for each of our server environments? Is there a way around this?

推荐答案

似乎无法做到;如错误消息所述,您只能为每个签名证书哈希/程序包名称组合的一个后端项目启用Google登录.我最终要做的是创建多个applicationIds( http ://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename )用于不同的productFlavors(每个端点一个).

It seems not possible as stated; as the error message says, you can only enable Google sign-in for one backend project per signing certificate hash/packagename combination. What I ended up doing is creating multiple applicationIds (http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename) for different productFlavors (one for each endpoint).

这篇关于适用于多个服务器环境的Android版Google登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆