Google Play Games Signin not working on some devices

42 Views Asked by At

I have a published android game project in Play Games services. It is working for majority of our users but upon testing we noticed that in some of the devices (eg. Redmi Note 9 pro, Realme 9A, etc) a user is not able to login at all.

my gradle file -

dependencies {
    .
    .
    implementation "com.google.android.gms:play-services-games-v2:19.0.0"
    .
    .
}

the code I am using for signin process -

PlayGamesSdk.initialize(mContext);
GamesSignInClient gamesSignInClient = PlayGames.getGamesSignInClient((Activity)mContext);
gamesSignInClient.isAuthenticated()
            .addOnCompleteListener(authTask -> {
                ConsoleLogger.r(TAG, "play games auth end result: " + authTask.getResult().isAuthenticated());
                if (authTask.getResult().isAuthenticated()) {
                    // success
                    return;
                }
                ConsoleLogger.r(TAG, "play games sign in start");
                gamesSignInClient.signIn()
                    .addOnCompleteListener(signInTask -> {
                        ConsoleLogger.r(TAG, "play games sign in end result: " + signInTask.getResult().isAuthenticated());

                        if (!signInTask.isSuccessful() || !signInTask.getResult().isAuthenticated()) {
                            // failure
                            return;
                        }
                        // success
                    });
 });

For devices where signin process is unsuccessful we observed that gamesSignInClient.signIn() does not even open an interactive window to choose/create play games profile. Also on same device I am able to automatically signin in other games.

For unsuccessful scenarios, we also saw that only addOnSuccessListener is triggered (not addOnFailureListener).

Few of the differences that I found in the logs from successful login devices to unsuccessful login devices are presence of log lines -

// unsuccessful login logs
02-21 12:57:45.505  2515 27482 I SignInPerformer-49: Requested scopes is empty. Promoting to `games_lite` & `drive_appfolder`. [CONTEXT service_id=1 ]
02-21 12:57:45.505  2515 27482 I SignInPerformer-49: (REDACTED) Handling request [%s], isFirstPartyCaller [%s]
02-21 12:57:45.507  2515 27482 I SignInPerformer-49: (REDACTED) java sdk version: [%s]  unity sdk version: [%s]
02-21 12:57:45.553  2515 27482 I ignInPerformer-49: Account selection requested, triggering interactive sign-in flow. [CONTEXT service_id=1 ]
02-21 12:57:45.561  2515 27482 I SignInPerformer-49: (REDACTED) signIn(%s): suppression is not allowed. Triggering resolution.
02-21 12:57:45.561  2515 27482 I SignInPerformer-49: (REDACTED) Reporting resolvable error for [%s]
02-21 12:57:49.958  2515 27430 E Volley  : [3051] BasicNetwork.performRequest: Unexpected response code 403 for https://www.googleapis.com/games/v1/players/me?language=en-IN
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]: Not allowed to access this API method.
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]: m.fre: fre{mInternalStatusCode=1003, clientStatusCode=1003, logMessage=Not allowed to access this API method.}
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.frd.a(:com.google.android.gms.optional_games@[email protected] (100000-0):2)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.fma.i(:com.google.android.gms.optional_games@[email protected] (100000-0):20)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.dpj.d(:com.google.android.gms.optional_games@[email protected] (100000-0):14)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.dpj.f(:com.google.android.gms.optional_games@[email protected] (100000-0):0)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.doc.i(:com.google.android.gms.optional_games@[email protected] (100000-0):2)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.fui.a(:com.google.android.gms.optional_games@[email protected] (100000-0):5)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.ful.a(:com.google.android.gms.optional_games@[email protected] (100000-0):4)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.chv.run(:com.google.android.gms.optional_games@[email protected] (100000-0):1)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.dbm.c(:com.google.android.gms.optional_games@[email protected] (100000-0):6)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at m.dbm.run(:com.google.android.gms.optional_games@[email protected] (100000-0):7)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at zjz.run(:com.google.android.gms@[email protected] (100306-461192076):0)
02-21 12:57:50.343  2515 27452 E PlayGamesServices[SignInIntentService]:    at java.lang.Thread.run(Thread.java:919)



// successful login logs
02-21 12:43:53.500 13461 27831 I SignInPerformer-35: Requested scopes is empty. Promoting to `games_lite` & `drive_appfolder`. [CONTEXT service_id=1 ]
02-21 12:43:53.501 13461 27831 I SignInPerformer-35: (REDACTED) Handling request [%s], isFirstPartyCaller [%s]
02-21 12:43:53.512 13461 27831 I SignInPerformer-35: (REDACTED) java sdk version: [%s]  unity sdk version: [%s]
02-21 12:43:53.535 13461 27831 I SignInPerformer-35: (REDACTED) Successfully resolved account: [%s]
02-21 12:43:54.224 13461 27831 I SignInPerformer-35: (REDACTED) Successfully authorized %s
02-21 12:43:54.233 13461 27831 I SignInPerformer-35: (REDACTED) Successfully found player (id [%s], originalId [%s], displayName [%s]) for account [%s]
02-21 12:43:54.238 13461 27831 I SignInPerformer-35: (REDACTED) Successfully found game: displayName [%s], applicationId [%s], packageName [%s]
02-21 12:43:54.274 13461 27831 I SignInPerformer-36: (REDACTED) Handling request [%s], isFirstPartyCaller [%s]
02-21 12:43:54.274 13461 27831 I SignInPerformer-36: Successfully brokered first-party unauthenticated GamesService [CONTEXT service_id=1 ]
02-21 12:43:54.294 13461 27815 I SignInPerformer-35: Connection from games connect service, returning false for shouldShowWelcomePopup. [CONTEXT service_id=1 ]

Need help in figuring out the root cause for why our app is not able to login the user in some of the devices while other apps can.

Thanks

0

There are 0 best solutions below