gpt4 book ai didi

android - Google Play 游戏强制登录

转载 作者:行者123 更新时间:2023-11-30 02:51:52 25 4
gpt4 key购买 nike

我有一个 Android 应用,它可以让 Google Play 游戏正常运行。大约一周前,我更新到较新版本的 BaseGameUtils(和 google-play-services_lib),并且在登录 Play 游戏服务时遇到了问题。当用户未登录时(故意 - 通过不单击登录按钮),每次启动 BaseGameActivity 时都会启动 Play 游戏服务的登录流程。我该如何防止这种情况发生?

我想要的行为是用户必须自愿单击登录按钮才能显示登录流程,然后每次都会自动登录,除非他们明确退出。 (这是我更新之前经常发生的事情)。

如果登录,则行为正常。仅当用户未登录时才会出现问题。

最佳答案

原因是它是 Google 故意添加的。他们的 BaseGameUtils 常见问题解答部分回答了这个问题。

来自FAQ :

[5] I don't like the new "auto sign in" feature of GameHelper. How can I disable it?

To disable this feature and return to the old behavior, you can edit GameHelper.java and set the DEFAULT_MAX_SIGN_IN_ATTEMPTS constant to 0, or call GameHelper.setMaxAutoSignInAttempts(0) at runtime, before calling GameHelper.setup() (or, correspondingly, from your Activity's onCreate method).

我使用了 DEFAULT_MAX_SIGN_IN_ATTEMPTS = 0。完美运行。

关于android - Google Play 游戏强制登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24000774/

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