gpgs blues

Hi,

 

I don’t know what else to try, so I’m reporting my experiences with the new gpgs plugin here.

 

I’m experiencing some really weird behaviour.

 

If I first call:

gpgs.init( callback )

as specified, the call back never gets called.

 

Only logcat output is is a “init()” message (debug activated in the plugin).

So I borrowed the code from the gpgs tictactoe project I found somewhere, and it calls gpgs.login() before gpgs.init().

With this gpgs.login() call I get the Google Games dialog, allowing me to select the account. The debug output, however, is discouraging:

D/plugin.gpgs( 3801): login() D/plugin.gpgs( 3801): Connection failure: D/plugin.gpgs( 3801): - code: sign in required D/plugin.gpgs( 3801): - resolvable: true D/plugin.gpgs( 3801): - details: ConnectionResult{statusCode=SIGN\_IN\_REQUIRED, resolution=PendingIntent{42d67598: android.os.BinderProxy@42d67538}, message=null} D/plugin.gpgs( 3801): - isUserInitiatedSignIn: true D/plugin.gpgs( 3801): - isExpectingResolution: false -- here the dialog to select account for google play games is shown! -- I select account and grant permissions. D/plugin.gpgs( 3801): Activity Result code:ok D/plugin.gpgs( 3801): Connection failure: D/plugin.gpgs( 3801): - code: internal error D/plugin.gpgs( 3801): - resolvable: false D/plugin.gpgs( 3801): - details: ConnectionResult{statusCode=INTERNAL\_ERROR, resolution=null, message=null} D/plugin.gpgs( 3801): - isUserInitiatedSignIn: true D/plugin.gpgs( 3801): - isExpectingResolution: false

… following this, every other subsecuent call results in the same INTERNAL_ERROR error code.

Any clues?

I’m fairly sure my build.settings and config.lua are fine, build.settings:

 

settings =

  plugins =
  {
    [“plugin.gpgs”] =
    {
        publisherId = “com.coronalabs”,
        supportedPlatforms = { android=true, [“android-kindle”]=true }       
    },
  }, 

– removed things here…
 android =
 {
    googlePlayGamesAppId = “RealIDOfMyGame”,
    versionCode = “11”,
  usesPermissions =
  {
   “android.permission.INTERNET”,
   – “android.permission.INTERACT_ACROSS_USERS_FULL”,
   – “android.permission.GET_ACCOUNTS”,   
  },
 },
}

config.lua:

 

application = {    license = {      google = { key= "extraLongString....",        policy = "Optional",        },      },   content = {  ... removed ... }, }

As an aside, I’m also surprised it is requesting access to google drive application data.

Any advice most welcome… or should I use the legacy plugin for the moment?

Thanks in advance,

jaime

… what a mess of message, the preview was clean. The log, again:

D/plugin.gpgs( 3801): login()

D/plugin.gpgs( 3801): Connection failure:

D/plugin.gpgs( 3801): - code: sign in required

D/plugin.gpgs( 3801): - resolvable: true

D/plugin.gpgs( 3801): - details: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{42d67598: android.os.BinderProxy@42d67538}, message=null}

D/plugin.gpgs( 3801): - isUserInitiatedSignIn: true

D/plugin.gpgs( 3801): - isExpectingResolution: false

– here the dialog is shown, account selected and permissions granted.

D/plugin.gpgs( 3801): Activity Result code:ok

D/plugin.gpgs( 3801): Connection failure:

D/plugin.gpgs( 3801): - code: internal error

D/plugin.gpgs( 3801): - resolvable: false

D/plugin.gpgs( 3801): - details: ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null, message=null}

D/plugin.gpgs( 3801): - isUserInitiatedSignIn: true

D/plugin.gpgs( 3801): - isExpectingResolution: false

Hope this reads better…

Ok, I decided to give a try to the legacy plugin, and it worked first try!

https://docs.coronalabs.com/daily/plugin/gameNetwork-google/index.html

I followed a lot of advice from this great old post (I was already trying to follow it for the new gpgs plugin):

https://forums.coronalabs.com/topic/50011-resolved-gpgs-gamenetworkinit-does-nothing-with-an-error-google-play-services-resources-not-found/

… also the permissions requested were much more logical (just access to google play games).

I’m not android guru, but I really find quite confusing all this, how the plugins actually behaves different as specified, callbacks not being called… it means a lot of time wasted looking for advice, and advice at times seems arcane recipes - do it this way because it works, even if it was supposed to work this other way.

Anyway, hope this helps!

jaime

jaime9, hi. Can you please send me your APK so I can see how it fails and maybe see why?

Standard questions. Do you have latest Google Play app installed on your device and using latest Corona daily build?

Google Drive is used by Google Play Games Services for managing saved games (snapshots).

Hi Lerg,

thank you so much for replying!

The thing is, I have it working now, only using the legacy library. The trick seems to be to ignore the callback in the “init” and “login” calls.

As I’m quite strong headed I’m going back to use the new gpgs with the same approach - I’ll report in a while.

jaime

No way with the new gpgs library - doing exactly the same (all calls have a 1-1 relation with the legacy lib) as I’m doing with the legacy one, I reach the point where I select the account and grant permissions, but then stuck at internal errors (as posted in my first message). Impossible to, for example, submit a high score.

With the legacy lib everything’s working fine, so there’s definitely a problem somewhere with the new one.

Thanks,

jaime

jaime9, to pin down the problem I need an APK with the problem. Can you please send it to me?

Did you manage to solve this? 

I’m having a similar issue. I’m 95% sure I have all the SHA1/module names etc. configured correctly and I call gpgs.init and gpgs.login in the correct order using callbacks. The app in the Developer Console registers a “request” but still, try as I might, I can’t get past the INTERNAL ERROR at login.  

Hi,

yes I did, but using the legacy gpgs API. It is working nicely since.

Lerg, I’m so sorry I missed your message. Is that still needed or the problem was identified any other way?

If needed, I’ll re-code it as soon as I get a chance (time, I mean).

Best regards,

jaime