Logging in user automatically to Google Play Game Services

Hi everyone,

I’m delving into using leaderboards for my game at the moment. I’ve finally been able to log in as a user with as documented here:

gameNetwork.request( "login", { userInitiated=true, listener=callback } )

My dilemma at the moment is that everytime I start my app, the log in dialog is displayed to prompt the user to sign in to their account. I find this quite inconvenient and dampens the user experience especially when they’re playing the game for the very first time after having just downloaded it.

What I would like is to set ‘userInitiated’ to false instead, which, according to the aforementioned documentation, should log the user in automatically without resolving any errors. I have tried this, however it is not logging in the user as I expected. It does seem like an error has occurred but there doesn’t seem to be any reasoning behind it whatsoever:

02-28 22:00:05.393: D/BaseGameActivity(21234): onCreate: creating GamesClient 02-28 22:00:05.413: E/GooglePlayServicesUtil(21234): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. 02-28 22:00:05.563: D/dalvikvm(16690): Note: class Lcom/google/android/gms/games/internal/dv; has 196 unimplemented (abstract) methods 02-28 22:00:05.808: D/BaseGameActivity(21234): onConnectionFailed: result 4 02-28 22:00:05.813: D/BaseGameActivity(21234): onConnectionFailed: since user didn't initiate sign-in, failing now.

Can anyone please shed any light on this? Would there be a problem if there is more than an google account on the device? I’m suspecting that perhaps it’s unable to log in automatically due to several google accounts being present on the device.

Any help would be greatly appreciated.

Kind regards,

Mark.

Ok just removed all of the Google accounts from the device bar one (a tester account), and wanted to confirm that it’s still not working.

Why not just call gameNetwork.init() at the beginning but do not call login, then when the user is ready, call the login code? 

Rob

Ok just removed all of the Google accounts from the device bar one (a tester account), and wanted to confirm that it’s still not working.

Why not just call gameNetwork.init() at the beginning but do not call login, then when the user is ready, call the login code? 

Rob