GKGameCenterViewController does not get disposed

Hi, I'm using the Unity plugins to access Game Center; there's a button in our UI that I want to use to open the Game Center dashboard on a particular leaderboard. The code for that is as follows, adapted from the GameKitSample.cs file:

var leaderboard = leaderboards.First(l => l.BaseLeaderboardId == MY_LEADER_ID);

var gameCenter = GKGameCenterViewController.Init(leaderboard, GKLeaderboard.PlayerScope.Global, GKLeaderboard.TimeScope.AllTime);

await gameCenter.Present();    // game never returns from here

Debug.Log("Back from Present()...");
gameCenter.Dispose();

I can play the game, hit the button, and view the Game Center dashboard, opened to the given leaderboard as expected. However, when I quit the dashboard (hitting the X in the top-right corner), the dashboard fades out, but the game is now unresponsive.

I did notice that elsewhere in GameKitSample.cs, we have the following:

var match = await GKMatchmakerViewController.Request(request);
match.Delegate.DidFailWithError += OnRealtimeMatchDidFailWithError;

Digging around for help with GKGameCenterViewController, I did notice that most solutions involve giving the viewcontroller a callback, but in the Unity plugin I see no Delegate listed for GKGameCenterViewController. Is this class missing the delegate, & therefore missing the callback that would dispose of the view?

Replies

Hi nrudzicz,

Thanks for the detailed issue report! This does indeed look like a bug in the plugin. We're taking a closer look & hope to have a fix soon.

Cheers, Brandon (Game Center Frameworks team)

Just by way of a post-holiday update, I've noticed that now when I press the X button in the top-right of the Game Center UI, nothing seems to happen, and so I can never return from Game Center back to the game.

Has there been much progress on a patch or a workaround for this issue?

We've fixed the Present issue. The fix will go out with the next open source release of the Unity plugins.

Regarding the X button: Please let me know what operating system you're running and if you have a minimum reproduction. Thanks!

Actually I'm testing our game again now, & I can't replicate my earlier issue – pressing X in the GC dashboard does indeed close the view. Might have been a false positive, or something else on our end that was affecting it. Please disregard!

And glad to hear about the Present fix. I'll keep an eye on the GitHub project for updates... thanks!

Actually I'm testing our game again now, & I can't replicate my earlier issue – pressing X in the GC dashboard does indeed close the view. Might have been a false positive, or something else on our end that was affecting it. Please disregard!

Hi nrudzicz,

Any idea what fixed this for you? We're currently experiencing this issue (using Unity and Apple Unity Plugins for GameKit) with no luck so far.

  • Unfortunately no, it seemingly was resolved on its own and I never tracked down what may have changed in the intervening months.

Add a Comment