Skip to content

Commit

Permalink
Handle CommonStatusCodes.RESOLUTION_REQUIRED during sign-in
Browse files Browse the repository at this point in the history
  • Loading branch information
olehkuznetsov committed Feb 28, 2019
1 parent f94aece commit 9e1f973
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,11 @@ public void onFailure(Exception exception) {
if (exception instanceof ApiException) {
statusCode = ((ApiException) exception).getStatusCode();
}
// INTERNAL_ERROR will be returned if the user has the outdated PlayServices
if (statusCode == CommonStatusCodes.SIGN_IN_REQUIRED || statusCode == CommonStatusCodes.INTERNAL_ERROR) {
// INTERNAL_ERROR in some PlayServices versions will be returned instead RESOLUTION_REQUIRED
// if the user has the outdated PlayServices or Play Games app is not installed
if (statusCode == CommonStatusCodes.SIGN_IN_REQUIRED
|| statusCode == CommonStatusCodes.INTERNAL_ERROR
|| statusCode == CommonStatusCodes.RESOLUTION_REQUIRED) {
if (!request.getSilent()) {
Intent signInIntent = signInClient.getSignInIntent();
startActivityForResult(signInIntent, RC_ACCT);
Expand Down

0 comments on commit 9e1f973

Please sign in to comment.