Game Center leaderboard works on TestFlight not on live app

I have a VisionOS app that uses a Game Center Leaderboard. On 'appear' of my content view, I check authentication, and if the user is auth'd, I display a 'leaderboard' button. This works on development / TestFlight – the little floating 'Game Center logged-in' pop up shows up when the app runs, and the button appears.

Tapping the button opens the leaderboard, and I can tap over to 'global' and see everyone's scores.

However, the app launched today on the App Store, and I'm having some issues.

  1. The leaderboard button isn't showing up, meaning that the auth call is probably failing silently. Not sure why. If I log out of Game Center on the device, and re-open the app, I'm able to auth and see my leaderboard button.

  2. Once I've done that, the leaderboard seems busted. On App Store Connect I can see the values that I expect (high scores from my beta test flight). But, on the production app, the leaderboard is just empty. And there's no 'global' tab to tap on.

Wondering if this is a propagation issue? Like, does it take time to roll out the Game Center entitlements when the app is live?

I'm going to distribute promo codes to try and get some more people with the App Store version testing for me to see what happens for them.

Any help appreciated!

Answered by Dreamwieber in 797706022

If anyone runs into this or similar issues, make sure your code handles the optional view controller that is vended as part of the Game Center authorization flow. The documentation mentions this – even though that VC may be nil in the dev/sandbox environment, that's not a guarantee that you can ignore it. Not 100% sure this was my issue, but by implementing code to present the VC if present, I no longer had issues with Game Center auth on production. I also never see the VC show up, but it's possible that it happens instantaneously – performing some additional work before closing immediately.

Tl;dr: make sure you handle the optional VC vended by the Game Center auth methods.

Accepted Answer

If anyone runs into this or similar issues, make sure your code handles the optional view controller that is vended as part of the Game Center authorization flow. The documentation mentions this – even though that VC may be nil in the dev/sandbox environment, that's not a guarantee that you can ignore it. Not 100% sure this was my issue, but by implementing code to present the VC if present, I no longer had issues with Game Center auth on production. I also never see the VC show up, but it's possible that it happens instantaneously – performing some additional work before closing immediately.

Tl;dr: make sure you handle the optional VC vended by the Game Center auth methods.

Game Center leaderboard works on TestFlight not on live app
 
 
Q