【发布时间】:2017-12-19 00:07:52
【问题描述】:
我按照https://developers.google.com/games/services/android/signin 上的说明操作,可以成功登录并从帐户(如 .getEmail() 等)获取数据。
但是当我尝试显示排行榜时,我得到了错误: java.lang.IllegalStateException:游戏 API 需要 https://www.googleapis.com/auth/games_lite 函数。
Games.getLeaderboardsClient(this, GoogleSignIn.getLastSignedInAccount(this))
.getLeaderboardIntent(getString(R.string.leaderboard_highscores))
.addOnSuccessListener(new OnSuccessListener<Intent>() {
@Override
public void onSuccess(Intent intent) {
startActivityForResult(intent, RC_LEADERBOARD_UI);
}
});
确实,
GoogleSignIn.hasPermissions(account, Games.SCOPE_GAMES_LITE));
返回假。
Google Play 控制台中的所有内容都应正确设置。 我也尝试过silentSignIn(),但没有成功。
这可能是什么问题?
【问题讨论】:
-
简短更新:我正在使用选项“DEFAULT_SIGN_IN”创建 googleSignInClient。切换到“DEFAULT_GAMES_SIGN_IN”时,我无法再登录。但是,当首先使用 DEFAULT_SIGN_IN 编译,然后使用带有“DEFAULT_GAMES_SIGN_IN”的 SilentSignIn 时,会授予 SCOPE_GAMES_LITE 权限。仍然无法显示排行榜...
-
Google Play Games的可能重复