SDKBox Play issue (Android)

Hi,
In Android (i repeat, only in Android) i’ve problems for login to google games and redirect to leaderboards.
This is my code:

void EventHandler::onTouchLeaderboardIcon()
{
  if(sdkbox::PluginSdkboxPlay::isSignedIn() == true)
      sdkbox::PluginSdkboxPlay::showAllLeaderboards();
  else
      sdkbox::PluginSdkboxPlay::signin();
}


void PlayHandler::onConnectionStatusChanged(int status)
{
    if(status == sdkbox::GPS_CONNECTED) 
            sdkbox::PluginSdkboxPlay::showAllLeaderboards();
}

In iOS it works perfect: if i’m not logged in to gamecenter, i log in and i’m redirected to leaderboards.

In Android, i debugged it, and when i call sdkbox::PluginSdkboxPlay::signin(), onConnectionStatusChanged is called but the status code is 1001 (GPS_DISCONNECTED) and i never view a login screen for log in.

I logged out from google games deleting my account in Settings > Accounts.
I’m using Android 6, with the last sdkbox.

It’s a bug? @yinjimmy

plz check adb logcat with tag SdkboxGPGAuthentication

I didn’t find that tag.
But I read this msg in logcat when I try to open the leaderboards:

I/SdkboxPlay: Request connect and was already connected.

we need sigin success first.

you got GPS_DISCONNECTED, have you invoke signout ?

No.
I deleted my account in Settings > Account but inside the game i never calls signout.

  1. deleted account in Setting->Account
  2. lanuch app
  3. sigin
  4. got GPS_DISCONNECTED

those steps?

Yes, exactly.

  1. deleted account in Setting -> Account
  2. lanuch app
  3. sigin
  4. google account login activity show
  5. login success

i can login success.

take a look at this sample.

It’s very weird, because onConnectionStatusChanged is called and the status is GPS_DISCONNECTED but i never called sdkbox::PluginSdkboxPlay::signout()
Did you test it on Android 6? The device that i’m using for test is Android 6 API 23.

i tested it with Android 5.1.
i have no Android 6 device now.

Any other possibility that may be the cause? :worried:

cause 1: signout invoked
cause 2: your activity’s onStop trigger

I didn’t understand. How would it be?

let me show a sample source code:

public class AppActivity extends com.sdkbox.plugin.SDKBoxActivity {

        @Override
	protected void onStop() {
		super.onStop();
	}

}

Hi,

I am facing the same issue. when the game goes to background Connection Status Changed to 1001. is this is a bug in sdkbox or did I miss anything?

Pls help me

I’m using Android 9, with the latest sdkboxplay.

Welcome to the club :pensive:
From my point of view, it’s a sdkbox bug.
I’m not doing anything wrong in my code.

@htlxyz maybe your team should test all cases that sdkbox changes the status to 1001. maybe something are wrong.

@yinjimmy is this a bug?

Let me check it with Android 6 today.

I check this issue today.
works with https://github.com/sdkbox/sdkbox-sample-cpp317/tree/sdkboxplay on Nexus 6P 6.0.1.

would you check with check list

I tested your app.

Redmi Note 2, Android 5.0.1, Google Play 12.1.18

case 1

  1. no account
  2. click Leaderboards
  3. nothing happen

case 2

  1. sign-in a account
  2. click Leaderboards
  3. welcome UI shows
  4. no Leaderboards UI
  5. restart app
  6. click Leaderboards
  7. Leaderboards UI shows.

Nexus 6P, Android 8.0.0, Google Play 11.9.14

case 1

  1. no account
  2. click Leaderboards
  3. nothing happen

case 2

  1. sign-in a account
  2. click Leaderboards
  3. welcome UI shows
  4. no Leaderboards UI
  5. restart app
  6. click Leaderboards
  7. Leaderboards UI shows.

Nexus 6P, Android 8.0.0, Google Play 12.1.18

case 1

  1. no account
  2. click Leaderboards
  3. nothing happen

case 2

  1. sign-in a account
  2. click Leaderboards
  3. welcome UI shows
  4. no Leaderboards UI
  5. restart app
  6. click Leaderboards
  7. Leaderboards UI shows.

But I test our sdkboxcpp317 sample.

  1. it can show account picker UI on Android 8, but not show on Android 6.
  2. sign-in success both on Android 8 & 6.

Let me do some researching.

What’s your cocos2d-x version?
do you use eclipse or android studio ?
I need more info about your project.