【发布时间】:2015-09-08 20:27:24
【问题描述】:
我将 Plus.API、Game.API 和 Drive.API 分别用于应用内购买、排行榜和保存游戏设置。
每次我进入游戏时,即使我多次拒绝登录,Google Play 游戏也会不断弹出。如何使 Games.API/Driver.API 仅显示一次登录,并且如果没有 INTERNET 连接停止弹出,直到用户下次启动游戏?
这是我的代码:
//--------------------- Google API INIT
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN) //used for Screenshot posting and Google Account for google api services
.addApi(Games.API).addScope(Games.SCOPE_GAMES) //user for Leaderboards
.addApi(Drive.API).addScope(Drive.SCOPE_APPFOLDER) //used for Game Saving
.build();
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
if (mGoogleApiClient.isConnected()) {
mGoogleApiClient.disconnect();
}
super.onStop();
}
【问题讨论】:
标签: google-drive-api in-app-purchase in-app-billing google-play-games google-api-client