gpt4 book ai didi

android - 为什么我不能为同一个包名称创建多个 OAuth 2.0 客户端 ID?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:29:29 24 4
gpt4 key购买 nike

教程中here ,声明完全可以对同一个包名称使用两个 OAuth 2.0 客户端 ID。

You should create two client IDs, one with the release certificate fingerprint and another with the debug certificate fingerprint. Make sure to use the same package name for both. This allows Play Games services to recognize calls from your linked APKs that are signed with either certificate

所以我按照上面链接中的教程进行操作:首先转到 Developer Console 中的 Game ServiceAdd a new Game。然后我在这个游戏中添加了一个Linked app,它要求我创建一个 OAuth 2.0 客户端 ID。使用我的发布 key 的 SHA1 创建第一个客户端 ID 后,我找不到任何按钮来创建另一个客户端 ID。所以我去 Cloud Developer Console并发现我可以在 APIs & auth-> Credentials 下创建第二个客户端 ID。我将我的 debug.keystore 的 SHA1 用于第二个客户端 ID。然后我使用调试 key 和发布 key 编译并测试我的示例游戏。

但是,在运行应用程序并尝试登录后,结果是只有使用发布 key (使用第一个客户端 ID)的应用程序被接受,而使用调试 key (使用第二个客户端 ID)的应用程序被接受) 不被接受。

然后我尝试在 Cloud Developer Console 中删除我的发布 key 的客户端 ID(以便调试 key 的客户端 ID 仍然是那里唯一的客户端 ID)并再次测试我的应用程序。这次接受使用debug key的app,当然不接受使用release key的app。

这是否意味着我不能为同一个包名称创建多个 OAuth 2.0 客户端 ID?

最佳答案

如同一 tutorial 中的红色警告注释中所述:

Warning: Do not create new client IDs for your game from the Google Developers Console. If you do so, Play Games services will not associate your game settings with the client ID, and this could cause errors during gameplay.

相反,在开发者控制台的游戏服务部分,转到 2。 Linked Apps 并选择 Link another app 并按照那里的说明进行操作,为其命名,例如“Game Name Debug”并使用调试 key SHA1(所有其他字段应与你的发布应用程序)。

关于android - 为什么我不能为同一个包名称创建多个 OAuth 2.0 客户端 ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21899344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com