Create apps that allow players to interact with each other using GameKit.

Posts under GameKit tag

56 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to use Unity Apple GameKit Plugin For Rule-based matchmaking?
Hello, **I'm Using ** Unity 6 LTS Unity Apple GameKit + Core plugins Turn-based matchmaking interface w/ 2 players max App Store Connect API for rule-based matchmaking I have already enabled game center in app store connect (I think) authenticated players and matched via friend request I am stuck Using queues to match players automatically I'm working on a rule-based matchmaking system which aims to place two players against each other into a GKTurnBasedMatch. I have a simple Unity Project that correctly authenticates a user and proceeds to send a matchmaking request. The matchmaking script utilizes the Unity plugins' GKTurnBasedMatchmakerViewController.Request(...) request function with a GKMatchRequest.Init() request configured with a QueueName equal to the App Store Connect API Queue I created. The queue I created is also linked to a ruleset with a very basic rule that checks if the properties contains a key called 'preference' that contains a string value for what side the player wants to play for this match. If during the matchmaking, the preferences between players are different, then the match is made and both players should join the match; each player gets to play the side they have chosen. I have my rule expression designed to just check if the preferences are not equal: requests[0].properties.faction_preference != requests[1].properties.faction_preference When I launch the game with two physical iPads and begin the matchmaking request, each player is immediately presented with two options: Invite a friend, or Start game The Problem: Inviting a friend works to get two players into a game, but queue seems to not matter, and clicking start game will just put the current player into its own match (no one joins). The Question: How do I get queue based matchmaking to work in Unity for a Turn-based match with only two players who are able to select the enemy side they want to play dictated by a rule that compares enemy play-side preferences? Resources I've used: Apple Unity GameKit Plugin: https://github.com/apple/unityplugins Matchmaking: https://developer.apple.com/documentation/gamekit/matchmaking-rules Multiplayer rulesets: https://developer.apple.com/documentation/gamekit/finding-players-using-matchmaking-rules
0
0
582
3d
Unity GameKit Plugin w/ Matchmaking Queue is not working
TLDR; I can't get QueueName to work with matchmaking a turn-based match in Unity using matchmaking rules. Long version: I'm using the apple unity plugin found here: https://github.com/apple/unityplugins/blob/main/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Documentation~/Apple.GameKit.md I have created a Queue, RuleSet and a simple Rule to match players by following these docs tightly: https://developer.apple.com/documentation/gamekit/finding-players-using-matchmaking-rules. Here is the single rule I have that drives matchmaking: { "data" : { "type" : "gameCenterMatchmakingRules", "id" : "[hiddden-rule-id]", "attributes" : { "referenceName" : "ComplimentaryFactionPreference", "description" : "default desc", "type" : "MATCH", "expression" : "requests[0].properties.preference != requests[1].properties.preference", "weight" : null }, "links" : { "self" : "https://api.appstoreconnect.apple.com/v1/gameCenterMatchmakingRules/[hidden-rule-id]" } }, "links" : { "self" : "https://api.appstoreconnect.apple.com/v1/gameCenterMatchmakingRules" } } which belongs to a rule set which belongs to a queue. I have verified these are setup and linked via the App Store Connect API. Additionally, when I tested queue-based matchmaking without a queue established, I got an error in Unity. Now, with this, I do not. However there is a problem when I attempt to use the queue for matchmaking. I have the basic C# function here: public override void StartSearch(NSMutableDictionary<NSString, NSObject> properties) { if (searching) return; base.StartSearch(properties); //Establish matchmaking requests _matchRequest = GKMatchRequest.Init(); _matchRequest.QueueName = _PreferencesToQueue(GetSerializedPreferences()); _matchRequest.Properties = properties; _matchRequest.MaxPlayers = PLAYERS_COUNT; _matchRequest.MinPlayers = PLAYERS_COUNT; _matchTask = GKTurnBasedMatch.Find(_matchRequest); } The _PreferencesToQueue(GetSerializedPreferences()); returns the exact name of the queue I added my ruleset to. After this function is called, I poll the task generated from the .Find(...) function. Every time I run this function, a new match is created almost instantly. No two players are ever added to the same match. Further, I'm running two built game instances, one on a mac and another on an ipad and when I simultaneously test, I am unable to join games this way. Can someone help me debug why I cannot seem to match make when using a queue based approach?
0
0
578
4d
GameKit Manage Game Progress does not work for Leaderboards
Works fine to show achievements but not Leaderboards. Launching the Xcode Project directly on device, loading remote (not yet live) leaderboards without issue and submitting scores to them works fine as well. I was hoping that rather than going through the app store distribution leaderboards with all of their limitations I could instead run it locally and add scores to test the behaviour, but even though I can edit the achievements progress locally, I can't see any leaderboards being available... One out of 3 leaderboards started beginning of this september while the other 2 leaderboards won't launch until the game launch.
0
0
80
5d
Game Activity link works when app is running, but not on cold start
I’m testing Game Activities in my Unity project with the new Apple.GameKit 2025-beta1 plugin. When I go into Xcode- Debug → GameKit → Manage Game Progress → Leaderboards → and click the generated link: If my app is already running in the background, the link opens the app and my handler (Apple.GameKit.GKGameActivity.WantsToPlay += OnWantsToPlay;) fires as expected. I can read the activity and route the player to the right level. If the app is completely closed, clicking the same link launches the app, but my OnWantsToPlay listener is never invoked. The app just boots normally and the activity intent seems lost. I’ve tried to subscribe as early as possible (in Awake() of my bootstrap scene, also tested with RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]). Nothing works. Also, “Get Started with Game Center” video only demonstrates activation when the app already running, not a cold start from a Game Activity link. What am I missing? Environment Device/OS: iPhone on iOS 26.0 beta (Game Center sandbox) Xcode: 26.0 beta 6 Unity: 2022.3.21 Apple GameKit Unity plugin: 2025-beta1 (GameKit package) Signing: Game Center capability enabled; using development provisioning profile GameKit resources: GameCenterResources.gamekit in project (Target: Unity-iPhone), appears under Build Phases → Copy Bundle Resources
0
0
56
1w
Game Center Challenges and Activities are not appearing
Hi, I'm trying to add game center challenges and activities to an already live game, but they are not appearing in game for testing, GameCenter, or the Games app. I know the game is setup with GameKit entitlements since this is a live game and it has working leaderboards and achievements. I've updated to Tahoe beta 8, added a challenge and activity on app store connect, added that to a new distribution and added that distribution to 'Add for Review' I'm using Unity and the Apple Unity plugin Not sure what other steps I'm missing Thanks
0
0
990
1w
GKLeaderboard.LoadLeaderboards() return empty when testing on Xcode with local gamekit file (Unity)
var allLeaderboards = await GKLeaderboard.LoadLeaderboards(); Log(allLeaderboards.Count); // returns 0 What am I missing?? What doesn’t work: await GKGameActivityDefinition.LoadGameActivityDefinitions() → count = 0 await GKLeaderboard.LoadLeaderboards() (no args) → 0 leaderboards await GKLeaderboard.LoadLeaderboards("MY ID") → returns 0 GkGameActivity.SetScoreOnLeaderboard(Leaderboard, score, context); returns an error since my Leaderboard is null. Activities and leaderboards are defined in GameCenterResources.gamekit in Xcode. Achievements that I add locally in the .gamekit file do not appear at runtime either; only ASC live ones show. ** What works:** xcode- debug- Gamekit- Manage Game progress- I can submit new scores with the plus button and see the notification on my device. await GKLocalPlayer.Authenticate() succeeds. await GKAchievement.LoadAchievements() returns the list of achievements configured in App Store Connect- but not any new local achievements created in Xcode in GameCenterResources.gamekit Environment Device/OS: iPhone on iOS 26.0 beta (Game Center sandbox) Xcode: 26.0 beta 6 Unity: 2022.3.21 Apple GameKit Unity plugin: 2025-beta1 (GameKit package) Signing: Game Center capability enabled; using development provisioning profile GameKit resources: GameCenterResources.gamekit in project (Target: Unity-iPhone), appears under Build Phases → Copy Bundle Resources
1
0
666
1w
Unity GameKit plugin beta GameKit Activity UnsupportedOperationForOSVersion
I’m running into unexpected problems with the Unity GameKit plugin setup with the new Activities. I didn’t see anyone else mentioning these issues, so my guess is that it’s a problem with my setup. The authentication (GKLocalPlayer.Authenticate()) works as expected, but any call to the new GameActivity functionality (e.g. GKGameActivityDefinition.LoadGameActivityDefinitions() or GKGameActivity.WantsToPlay) gives me an exception with a 'UnsupportedOperationForOSVersion' reason despite it running on an iOS 18.6.1 device. I’m using a completely empty Unity 2022.3.62f1 project that only contains the official authentication example, followed by an event handler for activities from another example and the Unity core and gamekit plugins. The setup: macOS 15.6 Xcode 26 beta 6 (also tried with 5) Physical iPhone device running iOS 18.6.1 Unity 2022.3.62f1, which satisfies the requirements Unity plugin, Xcode setup, and build steps: I Followed the official beta branch build steps for Unity plugins with python3 build.py -m iOS iPhoneSimulator macOS -p Core GameKit which ran through after a slight modification for the macOS target that somehow contained an unknown team reference for the GameKitWrapper project, which I changed to not reference a team and use ‘sign to run locally’, as was the case for the other packages. As far as I understood the macOS version is not strictly necessary either way just for running it on a local iOS device(?) I Imported these as tarball packages into the empty Unity 2022.3.62f1 project as per the official instructions, which seems to work as expected Added a single script with the mentioned example code added in a MonoBehavior.Start Building in Unity works as expected as well, creating the Xcode project The Unity-iPhone target has the GameKit framework linked (’do not embed’) and the GameCenter capability was added automatically as expected The GameKit framework seems to not be added to the UnityFramework target, but I don’t think this is necessary? Quickly testing this with the GameKit framework added there as well didn’t make a difference The linked GameKit framework is indeed the expected Xcode 26 beta version I can then build and run this on the physical iPhone iOS 18.6.1 device, where I get an ‘UnsupportedOperationForOSVersion’ as soon as I try to subscribe to deeplinking events (GKGameActivity.WantsToPlay) or use other GameKit Activity functionality from the official examples: // log showing that it's actually running on iOS 18.6: [Apple.Core Plug-In Runtime] Availability Runtime Environment: iOS 18.6 Apple.Core.Availability:OnApplicationStart() // and the exception I get: GameKitException: Code=-7 Domain=GKErrorDomain Description=The operation couldn’t be completed. (GKErrorDomain error -7.) (UnsupportedOperationForOSVersion) at Apple.GameKit.DefaultNSErrorHandler.ThrowNSError (System.IntPtr nsErrorPtr) [0x00000] in <00000000000000000000000000000000>:0 Rethrow as TypeInitializationException: The type initializer for 'Apple.GameKit.GKGameActivity' threw an exception. I unfortunately didn’t find any clues as to why this happens and how to resolve it on this forum or otherwise. Changing the minimum iOS version - up to 18.6 from the previously used (Unity export default) 12.0 for any and all targets - did not yield a different result I'd rather not update the phone to use the iOS 26 beta, though as far as I understood this is not necessary Any pointers to what I might be missing or doing wrong are greatly appreciated! Thank you very much in advance!
2
0
418
3w
Where's the replacement for Quartz Debug?
Hi, This can't be right. Is there really no replacement for Quartz Debug?!? As the sole developer on a project who has an Intel Mac and Quartz Debug, I am basically a god now. Everyone else has Apple Silicon and... I think they're randomly guessing at this point. Because I have entire teams sending me Intel Mac builds of stuff just so I can test it in QD. This is THE TOOL we used at NewTek to find performance issues, and THE TOOL I used for a dozen companies after that, to help them with similar issues. If there's no replacement, is there a reason there's no replacement? This feels like a massive step backwards, having to guess at problems like this. -Chilton
1
0
104
3w
GKAccessPoint triggerAccessPointWithState handler not invoked on iOS 26.0 and iOS 15.8.4
GKAccessPoint triggerAccessPointWithState handler not invoked on iOS 26.0 and iOS 15.8.4 Incorrect/Unexpected Behaviour: When calling [GKAccessPoint.shared triggerAccessPointWithState:GKGameCenterViewControllerStateAchievements handler:^{}] on a real device running iOS 26 beta (iOS 26), the overlay appears as expected, but the handler block is never called. This behavior also not working correctly on previous iOS versions(tested on iOS 15.8.4) Steps to Reproduce: Authenticate GKLocalPlayer Call triggerAccessPointWithState:handler: with a block that logs or performs logic Observe that overlay appears, but block is not executed Behavior: UI appears correctly Handler is not invoked at all Expected Result: The handler should fire immediately after the dashboard is shown. Actual Result: The handler is never called. Usecase: As GKGameCenterViewController is deprecated we are moving to GKAccesspoint but due to above functionality issue we are unable to. Environment: Device: iPhone 16, iPhone 7 iOS: 26.0 and iOS 15.8.4 Xcode: 26.0 beta and Xcode 16.4
5
0
143
1w
GKLocalPlayer.authenticateHandler not called on iOS 26 when Game Center auth overlay is shown
Hi — we’re testing our app on iOS 26 and ran into strange behavior with GKLocalPlayer.local.authenticateHandler. GKLocalPlayer.local.authenticateHandler = { [weak self] viewController, error in // additional code } What happens: When we assign authenticateHandler on iOS 26 and the user is not signed in to Game Center, the system shows a full-screen Game Center overlay asking the user to sign in. If the user taps Cancel, nothing further happens — the closure is not invoked again, so we don’t receive an error or any callback. The app never learns whether the auth was cancelled or failed. In previous iOS versions the closure was called (with viewController / error as appropriate) and the flow worked as expected. What we tried: Verified authenticateHandler is being set. Checked GKLocalPlayer.local.isAuthenticated after the overlay dismisses — it’s unchanged. Observed system logs: a com.apple.GameOverlayUI scene is created and later removed (so the auth overlay is shown by the system). Confirmed the same code works on earlier iOS versions. :thinking: Question: Has anyone seen authenticateHandler not being invoked on iOS 26 when the Game Center auth overlay is presented? Could this be a behavioral change in iOS 26 (overlay runs in a separate system process), or a bug? Any suggested workarounds to reliably detect that the user cancelled the sign-in (for example: listening for willResignActive / didBecomeActive, watching for a system overlay, or saving/presenting the viewController manually)? Thanks in advance for any advice — we’d appreciate pointers or suggested diagnostics ?
2
1
234
2w
App not showing in Game Center “All Activity” after release
Hello — I shipped an App Store build that signs in to Game Center using the Apple Unity Plugins (GameKit). The login banner appears, but my app still doesn’t show up in Game Center’s “All activity” (You started playing XXX 2d ago) What I’ve done Call await GKLocalPlayer.Authenticate(); “Game Center” is enabled for the current version in App Store Connect Confirmed: other App Store games do appear under “All Activity” on the same device/account Timeline: This is the first version that enables Game Center (not the app’s first release), and it has been about 2 hours since this build went live. Questions Is authentication alone sufficient for “Recently Played,” or is at least one Game Center component (leaderboards, achievements, activities, multiplayer) required? Is there a typical propagation delay before “Recently Played” starts showing a newly enabled app/version? Is there anything else I should configure in App Store Connect or entitlements to make “Recently Played” visible? Thanks for any help.
2
0
500
Aug ’25
Human Interface guideline for Game Center Login.
I can't find any documentation on design guidelines for "Login with Game Center" button. My app allows users to "Play as Guest" or "Login with Game Center". Since Apple provides somewhat strict guidelines for designing "Sign in with Apple" button, i was wondering how to design the button for Game Center login. Should i use Game Center icon. And will Apple review reject this?
0
0
179
Aug ’25
GameKit Achievements, Leaderboards and Challenges not showing on iOS 26 beta 4 in the Game Center UI (opened from GKAccessPoint)
On an iPad running iPadOS 26 beta 4, when tapping the Game Center Access Point, the overlay doesn’t show the configured achievements, leaderboards or challenges. I should specify this is an in-development app and the achievements and leaderboards are in the “Not Live” state, however they show on other devices running iOS 18 in the Access Point UI. Anyone else having this issue? If so, how should I test achievements and leaderboards while iOS 26 beta is out? The UI looks like this on iPadOS 26:
2
0
204
3w
Issues building Unity plug-in project: Cannot locate native library Apple.Core/Apple.GameKit for iOS
I'm having issues getting a well built package from the Apple Unity Plug-in project. When building the my game project in Unity the following error is printed to the console: Apple.Core.AppleNativeLibraryUtility] Cannot locate a Debug or Release Apple.Core native library for iOS. Please ensure that the build invocation (build.py, xcodebuild, or Xcode) compiled cleanly and that the build was configured to support Debug on iOS. As far as I can tell the build did compile cleanly, but I might be missing something. If anyone can see what I'm doing wrong or has any insight it would be greatly appreciated. Setup is the following: macOS Tahoe 26 Beta Xcode-beta Version 26.0 beta 3 (17A5276g) Unity Plug-in branch: 2025-beta1 Unity game project version: 2022.3.60f M1 Macbook Pro The built packages have been imported into the game project through the Unity Package Manager using the tarball option pointing to the built packages from the Unity Plug-in project. The Unity Plug-in project has been built using the build.py file with the following: python3 build.py -m iOS iPhoneSimulator -p Core GameKit CoreHaptics GameController -k all The output is available in the attached file. build-output.txt Here's an image of the NativeLibraries~ folder inside the built Apple.Core package.
2
0
256
Jul ’25
Blurry Game Center Achievement Images?
Hey all — I’ve been building out my first set of Game Center Achievements for a game I’m working on, and I’ve run into something odd with the image quality. The specs say to upload icons at 512x512 or 1024x1024@2x. I’ve been uploading 1024x1024 PNGs (without explicitly naming them “@2x” since there’s only one upload slot), assuming that Game Center would just handle the scaling automatically — kind of like how a lot of things are getting more streamlined across platforms lately. But in testing, the icons are showing up a bit blurry, especially in the Game Center interface. It’s not horrible, but it’s definitely softer than I expected — more like low-res than Retina. All my test devices (outside the Simulator) are running iOS 26, so I’m also wondering if this might be a beta-related display bug? Has anyone else run into this? Curious if I’m missing a best practice here, or if I really do need to ensure I’m uploading it with the @2x suffix, or maybe something else entirely? Thanks!
2
1
114
Jul ’25
How to verify with the appropriate signing authority that Apple signed the public key
Hello I trying to implement authentication via apple services in unity game with server made as another unity app On client side I succesfully got teamPlayerID signature salt timestamp publicKeyUrl According to this documentation https://developer.apple.com/documentation/gamekit/gklocalplayer/fetchitems(foridentityverificationsignature:)?language=objc I have to Verify with the appropriate signing authority that Apple signed the public key. As I said my server is special build of unity project So now I have this kind of C# programm to check apple authority over public certificate i got from publicKeyUrl TextAsset textAsset; byte[] bytes; textAsset = Resources.Load&lt;TextAsset&gt;("AppleRootCA-G3"); bytes = textAsset.bytes; rootCert.ChainPolicy.ExtraStore.Add(new X509Certificate2(bytes)); textAsset = Resources.Load&lt;TextAsset&gt;("AppleRootCA-G2"); bytes = textAsset.bytes; rootCert.ChainPolicy.ExtraStore.Add(new X509Certificate2(bytes)); textAsset = Resources.Load&lt;TextAsset&gt;("AppleIncRootCertificate"); bytes = textAsset.bytes; rootCert.ChainPolicy.ExtraStore.Add(new X509Certificate2(bytes)); rootCert.Build(cert); Where cert is X509Certificate2 object I ge from publicKeyUrl AppleIncRootCertificate AppleRootCA-G2 AppleRootCA-G3 is certificates I got from https://www.apple.com/certificateauthority/ But it is not work Anytime rootCert.Build(cert); return false Why it is not work? May be I build keychain using wrong root CA cert? Or whole approach incorrect? Please help
1
0
78
Jun ’25
GameKit not working as expected in iOS 26.
I just upgraded my macOS, Xcode and Simulator all to the newest beta version 26. Then I found two issues when building my app with Xcode 26 and running it on simulator 26. The game center access point no longer shows up in the app. This is how it's configured in the past. And it still works on simulator 18.4 func authenticatePlayer() { GKAccessPoint.shared.location = .topTrailing self.localPlayer.authenticateHandler = { viewController, error in if let viewController = viewController { // can present Game Center login screen } else if self.localPlayer.isAuthenticated { // game can be started } else { // user didn't log in, continue the game without game center } } } After game ended, the leaderboard won't load. This is how it's implemented in the past. It's still working in simulator 18.4 struct GameCenterView: UIViewControllerRepresentable { @Environment(\.presentationMode) var presentationMode ... func makeUIViewController(context: Context) -> GKGameCenterViewController { let viewController = GKGameCenterViewController( leaderboardID: getLeaderBoardID(with: leaderBoardGameMode), playerScope: .global, timeScope: .allTime ) viewController.gameCenterDelegate = context.coordinator return viewController } func updateUIViewController(_ uiViewController: GKGameCenterViewController, context: Context) {} func makeCoordinator() -> Coordinator { Coordinator(self) } class Coordinator: NSObject, GKGameCenterControllerDelegate { let parent: GameCenterView init(_ parent: GameCenterView) { self.parent = parent } func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController) { parent.presentationMode.wrappedValue.dismiss() } } }
3
2
218
Jun ’25
WWDC25 Metal & game technologies group lab
Hello, Thank you for attending today’s Metal & game technologies group lab at WWDC25! We were delighted to answer many questions from developers and energized by the community engagement. We hope you enjoyed it and welcome your feedback. We invite you to carry on the conversation here, particularly if your question appeared in Slido and we were unable to answer it during the lab. If your question received feedback let us know if you need clarification. You may want to ask your question again in a different lab e.g. visionOS tomorrow. (We realize that this can be confusing when frameworks interoperate) We have a lot to learn from each other so let’s get to Q&A and make the best of WWDC25! 😃 Looking forward to your questions posted in new threads.
2
0
323
Jul ’25
Game Center Challenges not showing in App Store Connect or xcode 16.4
Apple just introduced a new Challenges feature in Game Center (WWDC 2025). I have Game Center enabled for my app and have working leaderboards (and achievements). Now I want to implement challenges (connected to my leaderboards). But the Game Center Challenges not showing in App Store Connect or Xcode 16.4 I have a working GameCenterResources file in Xcode and it allows me to add Achievement, Leaderboard, Leaderboard Set, but no Challenges. I'm based out of Europe. Any ideas?
3
0
153
Jun ’25