Hi,
I’ve problems with SDKBOX Play in Android.
This is my method for show the leaderboards:
void EventHandler::onTouchLeaderIcon(Ref *pSender)
{
if(sdkbox::PluginSdkboxPlay::isSignedIn() == true)
sdkbox::PluginSdkboxPlay::showAllLeaderboards();
else
{
sdkbox::PluginSdkboxPlay::signin();
redirectToEventPlayLeaderBoard = true;
}
}
If the player has logged in, leaderboards will show.
Else, I invite the player to login in GameCenter or Google Play. And after login ok, I redirect to the leaderboards.
This is the method onConnectionStatusChanged
(Listener)
void PlayHandler::onConnectionStatusChanged(int status)
{
if(status == sdkbox::GPS_CONNECTED
&& EventHandler::getInstance()->getRedirectToEventPlayLeaderBoard() == true)
{
EventHandler::getInstance()->onTouchLeaderIcon(NULL);
EventHandler::getInstance()->setRedirectToEventPlayLeaderBoard(false);
}
}
If the status is GPS_CONNECTED
(login ok) and the flag for redirect to the leaderboards is true (redirectToEventPlayLeaderBoard
) then I call again onTouchLeaderIcon
for show the leaderaboards (this method should enter in the first if statment because isSignedin
is true).
Ok, this logic in iPhone works perfect. If I logged in to GameCenter, the method shows me the leaderboards. If not, the method invites me to log in to GameCenter and If i login ok I redirect to the leaderaboards.
My problem is with Android.
I’m testing in a real Android device and I don’t understand why it’s not work (the code is the same for Android and iOS). In the app “Play Games” I logged in with my gmail / user. After that I touch the leaderaboards icon and Play Services tries to init but I’m not redirect to the leaderaboards or login.
I only view the init box of Google Play and after that it disappears.
I debugged it, and when I touch the icon, the method onTouchLeaderIcon
is called and isSignedIn
is false (I don’t understand why because I signed in to play services).
Then, sdkbox::PluginSdkboxPlay::signin();
is called and the listener calls the method onConnectionStatusChanged
but the problem is that the status is 1001! (sdkbox::GPS_DISCONNECTED
). Why? I never call sdkbox::PluginSdkboxPlay::signout()
Because of it, I never redirects to the leaderboards.
The main problem is why isSignedIn is false? I’m logged in.
And why if i’m calling sigin() I don’t view the inputs for login?
I repeat, in iOS works perfect and the code is the same. @nite ? @yinjimmy ? Anyone?
Maybe any debug mode? But is false… the app is published and it doesn’t work.