Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
showALLleaderboards — Gideros Forum

showALLleaderboards

billydbbillydb Member
edited July 2016 in General questions
Does anyone know if it's possible to show a list of all your games leaderboards in google play for Android? I can load individual leaderboards using the id but I'd really like to avoid having to make a new menu with a scrollable leaderboard list if google has a built in version.

I found this:

http://stackoverflow.com/questions/21993424/list-all-the-leaderboards-in-google-play-game-services

but not sure how to translate that to the gideros gaming plugin.

Thanks

Comments

  • antixantix Member
    edited July 2016
    Have you tried passing no parameter at all to Gaming:showLeaderboard()?
  • Yeh tried but it crashed :)
  • antixantix Member
    Darn, how about an empty string?
  • Found a quick hack. Inside GameGoogleplay.java edit the showLeaderboard method:
    public void showLeaderboard(final String id) {
           	if(mHelper != null && mHelper.isSignedIn())
           		//sActivity.get().startActivityForResult(Games.Leaderboards.getLeaderboardIntent(mHelper.getApiClient(), id), RC_UNUSED);
    		sActivity.get().startActivityForResult(Games.Leaderboards.getAllLeaderboardsIntent(mHelper.getApiClient()), RC_UNUSED);
    	}
    Tried to make a duplicate function and then tried to make it conditional on if there's a string or not but it kept crashing and I think I only want to load all leaderboards anyway. Will keep trying but at least you can now access all leaderboards without having to make a separate menu :)
  • oh and using that you still have to include a string or it crashes. I think I'm stuck with it as I can't debug and login.
  • antixantix Member
    edited July 2016
    Hey @billydb, when you try to debug it do you get the whole "app is not configured correctly" dialog when you attempt to login? that's what I receive so I can't debug on device :(
  • yep exactly. I also can't login when doing a signed release apk, just with the signed debug apk, but I think that's deliberate by google. Although hard to say as it's not mentioned anywhere :)
  • simwhisimwhi Member
    @antix @billydb I'm not sure if this will help, but I always upload a release version to beta before testing IAB, otherwise you cannot purchase items.

    Just an idea.

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • antixantix Member
    Thanks simwhi, I can't make this stuff work anyway so I'll never have purchasing anyway ROFLMAO =))
  • simwhisimwhi Member
    @antix Are you still using Android Studio? I can help with IAB if you need it.
  • antixantix Member
    @simwhi thanks. I tried implementing IAB today and it messed up everything. The project no longer works with gaming plugin now for some unknown reason. I really don't know what the heck I'm doing wrong.
  • simwhisimwhi Member
    @antix I'm sorry to hear that. Everything was starting to come together!!
  • antixantix Member
    @simwhi yep it seemed to be :(
  • sorry to here your woes @antix
    I'm not using IAB but not suprised it's broken things. And just to be clear, totally not Gideros issue, you guys are great:) It's stinky evil mega corp google. I thought xcode was a pain but it's an absolute dream compared to Android Studio.

    In lightner news I finally got a hack working to show all leaderboards or just one:
    public void showLeaderboard(final String id) {
    		String temp = "all";
           	if(mHelper != null && mHelper.isSignedIn())
           		//sActivity.get().startActivityForResult(Games.Leaderboards.getLeaderboardIntent(mHelper.getApiClient(), id), RC_UNUSED);
    			if (id.equals(temp)) {
    				sActivity.get().startActivityForResult(Games.Leaderboards.getAllLeaderboardsIntent(mHelper.getApiClient()), RC_UNUSED);
    			}else{
    				sActivity.get().startActivityForResult(Games.Leaderboards.getLeaderboardIntent(mHelper.getApiClient(), id), RC_UNUSED);
    			}
     
    	}/pre>
     
     
    So in Gideros I load all by doing googleplay:showLeaderboard("all")

    Likes: antix

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    @billydb,
    are you ok if I add your change to github for next release ? I'd rather check for null string instead of "all", since that was your initial thought :)
  • antixantix Member
    Thanks @billydb, at least you are getting somewhere with your stuff, great job :)
  • @hgy29, absolutely. I'm nervous about anyone referencing my code as I code like a butcher performing brain surgery, but feel free :)
    +1 -1 (+4 / -0 )Share on Facebook
  • NinjadoodleNinjadoodle Member
    edited July 2016
    "I code like a butcher performing brain surgery" - rotfl :)) :)) :)) :)) :))
Sign In or Register to comment.