問題描述
statusCode=SIGN_IN_REQUIRED, resolution=null 只有開發者 ID 可以登錄 else 錯誤 (statusCode=SIGN_IN_REQUIRED, resolution=null Only developer Id can Login else error)
GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN
只允許我的開發者 ID 登錄,否則,如果我嘗試使用其他 ID,則會引發錯誤
statusCode=SIGN_IN_REQUIRED,分辨率=null
如何使用其他 id 登錄?
public void signin()
{
mGoogleSignInClient= GoogleSignIn.getClient(this, GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN);
Intent intent= mGoogleSignInClient.getSignInIntent();
startActivityForResult(intent, REQ_CODE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode==REQ_CODE)
{
GoogleSignInResult result= Auth.GoogleSignInApi.getSignInResultFromIntent(data);
handleResult(result);
}
Error is LoginResult: Status{statusCode=SIGN_IN_REQUIRED, resolution=null}
參考解法
方法 1:
You need to add Tester account in your Google Console for your project See the following link for more. https://developers.google.com/games/services/console/testpub Thanks
(by Umer Khaldi、Umer Ik)