我有一个使用Google Fit的应用程序。集成代码已从Google文档中复制:
if (!GoogleSignIn.hasPermissions(GoogleSignIn.getLastSignedInAccount(this), fitnessOptions)) {
GoogleSignIn.requestPermissions(
this, // your activity
GOOGLE_FIT_PERMISSIONS_REQUEST_CODE,
GoogleSignIn.getLastSignedInAccount(this),
fitnessOptions);
} else {
accessGoogleFit();
}
在调试模式下,一切正常,但是当我的应用程序从Google Play下载时,它始终会提示您选择要使用的Google帐户:
仅当从Google Play下载应用程序时,问题才会出现。将应用程序与adb一起安装时,一切正常。
Google Play服务似乎没有缓存上次选择的帐户。
请帮助我,这里的问题在哪里?
哆啦的时光机
相关分类