Only window of achievements, no leaderboards

I can not show the leaderboard window. Only the achievement window is showing.


GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];

if (gameCenterController != nil)

{

gameCenterController.gameCenterDelegate = self;

//not available for tvOS gameCenterController.viewState=GKGameCenterViewControllerStateLeaderboards;

[self presentViewController: gameCenterController animated: YES completion:nil];

}

Any advices? Thank you!

Answered by Brian Greenstone in 74463022

Man, I really wish I could post screenshots like I could with the old Developer Forum...


Are your Leaderboard icons in the images.xcassets root level? Not in the Brand Assets, right? Also, in the Info pane on the right there is a Layers list. Be sure that list matches what you gave it. I've got Leaderboad icons with both 3 and 2 layers, and they seem to be working.


-Brian

Yeah I have this same problem. How do you get the leaderboard to show instead of achievements?

I wrote up a bug for Apple regarding this, and here's what I heard back:


Leaderboards are available in the Apple TV UI, but it’s required that you create TV-specific images in your asset catalog in Xcode.


Has anyone tried this yet? Do we just add the Leaderboard Set to the xcassets? Does anything else need to be done to make that work?


-Brian

Have you heard anything else from Apple on how exactly we're supposed to display their Leaderboard UI when the viewState property isn't available?

Yes! I finally figured it out, and was able to get my leaderboards showing up this morning. After contacting Apple about the problem I got clarification, and here's exactly what you have to do:


1. In your Xcode project select your Images.xcassets. You should see your Brand Assets and LaunchImage appear in the next column.

2. Right-click under those files, and from the menu select Game Center->New AppleTV Leaderboard.

3. Add your art to the icon.

4. Now, here's the trick that makes it all work: with the Leaderboard selected view the asset's info in the info pane on the right side and be sure to select the little editor icon (not sure what else to call it). This shows you the "Game Center Leaderboard" info, and here is field for "Identifier". Here you simply enter the com.yourcompany.yourapp.yourleaderboard identifier for the leaderboard that icon is for.


Now, when you run the app everything will work perfectly!


I'd attach screenshots, but it appears the new Developer Forum doesn't have an option for image attachements 😟


-Brian

Okay I got it working. I guess there's no way to just display a specific leaderboard just yet (if ever). All your leaderboard image icons appear above the Achievements. I hope Apple does implement the viewState and leaderboardIdentifier properties at some point as I'd like to be able to display a specific leaderboard that's relevent to the level a player is on. One of my games has over 60 leaderboards. I imagine I'll have to group those into sets 'cos I don't feel like creating 60 multi-layered leaderboard images!! Thanks for the valuable info Brian. No idea how Apple expected us to guess how to do that without instructions.

Yeah, I guess for specific leaderboards you'd have to just do your own UI.


The good things about this new system, however, is that now it doesn't show my old "retired" leaderboards. Our most popular game is Air Wings, and it's 3.5 years old. We have retired the leaderboards and started new ones twice during that time, and since ITC doesn't provide any way to delete old leaderboards we always had these ugly things sitting around. At least now on the AppleTV it will only show the leaderboards that we want it to see, so the user doesn't see all of the retired ones.


-Brian

Thanks,


Yeah, I managed to get a leader board on screen now.


The image resolution to use for the icons remains unclear though:


The compiler will warn if it is not "602x339"

However, the app store will give a sumbission error is it is not "659x371"


So, which is it? "602x339" or "659x371" ?


Bram

Thanks Brian,


I still can not understand. How can you set viewState and leaderboardCategory properties of GKGameCenterVeiwController ?


     gameCenterViewController.viewState = GKGameCenterViewControllerStateLeaderboards;
     gameCenterViewController.leaderboardTimeScope = GKLeaderboardTimeScopeToday;
     gameCenterViewController.leaderboardCategory = leaderboardID;


Xcode7.1b3 still shows me "view State is unavailable: not available on tvOS"

How can you do that ?


Thanks

Yos

You can't use viewstate to select leaderboards, but you can show the Achievements view.

If you have the assets for leaderboards, the leaderboards will be shown on that same achievement screen, above the achievements.


bram

It sounds like a big point of confusion is that the GKGameCenterViewController instance, at least for now, makes all the decisions on just what content to present.


So, the leaderboard identifier in the asset catalog should be your app's bundle ID (as shown in iTunes Connect) with the leaderboard ID (as shown in iTunes Connect) tacked onto the end? I can't seem to get anywhere with any premutation of this. My leaderboard is a group leaderboard, but I've tried the original leaderboard's ID (the one used as the starting point for the group leaderboard) as well with no results. It sure would be nice if it'd just produce an error.

Yep, the key is having the bundleID in the asset catalog's info field. Apple really needs to get some documentation on this because I would have never figured all this out on my own in a million years.


-Brian

Hi I inserted the Game Center image assets from the menu and provided icons for the fron-middle-back layers. Also set the identifier at the right pane. But still I have "No content" error under the Leaderboard section. Could you please tell me how to provide content to the leaderboard? Thank you!

It didn't work when I tried entering the identifier as "com.yourcompany.yourapp.yourleaderboard" style. However, when I used just the name of the unqualified leaderboard, it then worked.

In the project's Build Settings do a search for Leaderboar and you'll see under Asset Catalog Options a "Leaderboard Identifier Prefix". I don't know if this makes any difference, but I set mine to the full leaderboard com.xx.xx.xx thing and it works.


-Brian

At last, I got it working !

In my case, identifier is not "com.xx.xx.myleaderboardID", only "myleaderboardID".


Thanks anyway.

Yos

Only window of achievements, no leaderboards
 
 
Q