Hi everyone,
I have the code below setup to log in to gpgs and I am trying to pull in the account name so I have a unique identifier for the client that is tied to their gpgs account.
_ local loggedintogpgs = 0; _
_ local accountname = “”; _
function gpgsGetAccountNameListener ( event )
_ infopopup.InfoPopup:create _
_ { _
title=“gpgsGetAccountNameListener() callback”,
_ lines= _
_ { _
json.prettify(event)
_ } _
}:display()
_ if not event.isError then _
_ – Do account name stuff _
_ accountname = event.accountName; _
_ end _
_ end _
gpgsLoginListener = function ( event )
_ if not event.isError then _
_ if loggedintogpgs==0 then _
_ loggedintogpgs=1 _
gpgs.getAccountName( gpgsGetAccountNameListener )
_ end _
_ end _
_ end _
gpgsInitListener = function ( event )
_ if not event.isError then _
gpgs.login( { userInitiated=true, listener=gpgsLoginListener } )
_ end _
_ end _
gpgs.init( gpgsInitListener )
Everything above works fine except that the callback to _ gpgsGetAccountNameListener _never happens and I can’t seem to figure out why, and I do believe my permissions are setup with the following:
_ – _
_ – Android section _
_ – _
_ android = _
_ { _
_ googlePlayGamesAppId = “XXXXXXXXXX”, _
_ usesPermissions = _
_ { _
_ “android.permission.INTERNET”, _
_ “android.permission.GET_ACCOUNTS” _
_ }, _
_ }, _
Does anyone have experience using the gpgs.getAccountName function? Or is there some other preferred way to pull in the users account name?
Cheers ~