When running my game in the Unity Editor on Windows platform I get an error:
DllNotFoundException: GameKitWrapper assembly:<unknown assembly> type:<unknown type> member:(null)
Apple.GameKit.DefaultNSErrorHandler.Init () (at ./Library/PackageCache/com.apple.unityplugin.gamekit@0abcad546f73/Source/DefaultHandlers.cs:35)
This is because GameKitWrapper dynamically linked library is not available under Windows platform.
Besides, "Apple Build Settings" are declared under UNITY_EDITOR_OSX and also not available under Windows platform.
Does anyone managed to solve this?
GameKit
RSS for tagCreate apps that allow players to interact with each other using GameKit.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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<TextAsset>("AppleRootCA-G3");
bytes = textAsset.bytes;
rootCert.ChainPolicy.ExtraStore.Add(new X509Certificate2(bytes));
textAsset = Resources.Load<TextAsset>("AppleRootCA-G2");
bytes = textAsset.bytes;
rootCert.ChainPolicy.ExtraStore.Add(new X509Certificate2(bytes));
textAsset = Resources.Load<TextAsset>("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
I would like a monthly recurring leaderboard, but the most days one can set for the recurring leaderboard is 30, and some months have 31 days (or 28/29). This is dumb. I guess I have to manually reset a classic leaderboard each month to get this result?
Additionally once it closes and is about to reset (I also have daily recurring leaderboards), I'd like to grant the top placers on the leaderboard a corresponding achievement, but I don't see any way of doing this.
I believe I can do all these things on PlayFab, but it'll take a bit more work, and eventually cost.
Any one have advise?
Topic:
Graphics & Games
SubTopic:
GameKit
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
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?
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
Topic:
Graphics & Games
SubTopic:
GameKit
Tags:
GameKit
Graphics and Games
App Store Connect
Apple Unity Plug-Ins
I have several games on the app store which are setup as "For Kids" which means these games cannot have any way to access the outside world including the App Store. No problem. These games have worked fine for years until iOS 26.
Now, all my updates are being rejected because the new version of Game Center running on iPadOS 26 has a way for people to exit the game and go to the App Store. I have no control over this since it's built into Game Center, and the app review folks want me to put a "parental gate" on it, but there's no way to do that because... well... it's in Game Center, not my code.
So, I'm unable to update my apps because of this. Presumably, the existing versions on the app store still do this exact same thing, so my update isn't going to make any difference. Does anyone know of a way to make that crap at the top go away so this isn't an issue?
Topic:
Graphics & Games
SubTopic:
GameKit
i play Roblox and ever since I've got this update the quality graphics stability Internet ping and a lot of other stuff has drastically been worse
Attempting to bring up the access point yields the following error log:
[GameCenterOverlayService] Failed to create GameOverlayUI Dashboard Remote Proxy
[GameCenterOverlayService] Could not create endpoint for service name: com.apple.GameOverlayUI.dashboard-service
[GameCenterOverlayService] Failed to create GameOverlayUI Dashboard Remote Proxy
[GameCenterOverlayService] Could not create endpoint for service name: com.apple.GameOverlayUI.dashboard-service
[GameCenterOverlayService] Failed to create GameOverlayUI Dashboard Remote Proxy
[GameCenterOverlayService] Failed to create GameOverlayUI Dashboard Remote Proxy
The same code (which is a single line setting 'active' to true) works on physical devices and on the simulator in iOS 18.6
I haven't been able to find any mention of this issue online. Any suggestions or help greatly appreciated.
Hi everyone
I'm experiencing an issue with iPadOS 26 regarding multi-touch gesture detection. When performing a quick four-finger gesture (tap and swipe), the system often fails to recognize the input. This especially affects multi-touch gestures, such as rhythm games with difficult levels.
Steps to Reproduce:
Place four fingers on the screen.
Perform a quick tap or a quick horizontal swipe (like the one used to switch apps).
Observe whether the gesture is ignored or detected inconsistently.
Expected Behavior:
4-finger multitouch gestures should be recognized regardless of gesture speed, just like previous iPadOS versions.
Actual Behavior:
Gestures fail to be detected when executed quickly—same gestures still work, and miss notes in rhythm games.
You can check out my posts on Twitter/x and Facebook: [https://x.com/kokona_fwa/status/1978131164104728949?s=61]
Facebook: [https://m.facebook.com/groups/idipad/permalink/24438964899058806/?]
Matchmaking rules
https://developer.apple.com/documentation/gamekit/matchmaking-rules?language=objc
AppStoreConnectApi rules
https://developer.apple.com/documentation/appstoreconnectapi/rules?language=objc
・Environment
Unity 6000.2.2f1
XCode 16.1
iOS 26
3 iPhones
・AppStoreConnectApi rules
"type": "gameCenterMatchmakingRuleSets",
"id": "f6a88caf-85db-42bf-xxxxxxxxxxxxxxxxxxxx",
"attributes": {
"referenceName": "co.mygame.RuleSets.GvERandom34",
"ruleLanguageVersion": 1,
"minPlayers": 3,
"maxPlayers": 4
},
"type": "gameCenterMatchmakingRules",
"id": "6afa68ce-4d2c-496f-xxxxxxxxxxxxxxxxxxxx",
"attributes": {
"referenceName": "GameVersion",
"description": "Check Game Version. GvERandom34",
"type": "COMPATIBLE",
"expression": "requests[0].properties.gameVersion == requests[1].properties.gameVersion",
"weight": null
},
"type": "gameCenterMatchmakingQueues",
"id": "7fb645ef-4eca-4510-xxxxxxxxxxxxxxxxxxxx",
"attributes": {
"referenceName": "co.mygame.que.GvERandom34",
"classicMatchmakingBundleIds": []
},
・Objective-C Execution code
queueName = "co.mygame.que.GvERandom34"
keyStr = "gameVersion "
valueStr = "1.0"
- (void)MatchQueueParamStr1Start:(NSString*)queueName keyStr:(NSString*)keyStr valueStr:(NSString*)valueStr
{
if (@available(iOS 17.2, tvOS 17.2, macOS 14.2, visionOS 1.1, *) == NO)
{
DBGLOG(@"MatchQueueParamStr1Start Not support.");
return;
}
self->_matchMakingFlag = YES;
self->_matchFinishFlag = NO;
self->_myMatch = nil;
GKMatchRequest *req = [[GKMatchRequest alloc] init];
if (@available(iOS 17.2, tvOS 17.2, macOS 14.2, visionOS 1.1, *))
{
req.queueName = queueName;
req.properties = @{keyStr: valueStr};
}
[[GKMatchmaker sharedMatchmaker] findMatchForRequest:req withCompletionHandler: ^(GKMatch *match, NSError *error)
{
if (error)
{
[self SetupErrorInfo:error descriptionText:@"findMatchForRequest"];
}
else if(match)
{
self->_myMatch = match;
self->_myMatch.delegate = self;
}
self->_matchMakingFlag = NO;
self->_matchFinishFlag = YES;
}];
}
・
I'm trying to match with three devices.
Matching doesn't work.
5 minutes later times out.
What's the problem?
I am using the latest version of the Game Center plugin for Unity and have noticed that my game will crash on launch when trying to authenticate.
I've tried this in an empty project with just the plugin and it still crashes with this exception.
GfxDevice: creating device client; threaded=1; jobified=0
Initializing Metal device caps: Apple A14 GPU
Initialize engine version: 2022.3.62f2 (7670c08855a9)
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.
And the area in the native code that is triggering the crash is this inside the GKLocalPlayer_SetAuthenticateHandler function
`_onAuthenticate!(tid, _mostRecentAuthenticatePlayer!.passRetainedUnsafeMutablePointer());
I am using Unity 2022.3.62f2 and MacOS 15.6 with iOS 18.6.2 which based on the min specs for the plugin we should be within spec.
I have also included this message because I thought it might help too
`terminating due to uncaught exception of type Il2CppExceptionWrapper
Could not import Swift modules for translation unit: failed to get module "GameKitWrapper" from AST context:
error: 'GKErrorCodeExtension.h' file not found
in file included from :1:
error: could not build Objective-C module 'GameKitWrapper'
warning: Ignoring missing VFS file: /Users/james/Library/Developer/Xcode/DerivedData/GameKitWrapper-dzawbtxqdxdviiakfxmfunexppqv/Build/Intermediates.noindex/GameKitWrapper.build/Release-iphoneos/GameKitWrapper-bc72bd3638f4d2956cac9b00e84c1a7d-VFS-iphoneos/all-product-headers.yaml
This is the likely root cause for any subsequent compiler
errors.warning: Ignoring missing VFS file: /Users/bill/Library/Developer/Xcode/DerivedData/GameKitWrapper-dzawbtxqdxdviiakfxmfunexppqv/Build/Intermediates.noindex/GameKitWrapper.build/Release-iphoneos/GameKitWrapper iOS.build/unextended-module-overlay.yaml
This is the likely root cause for any subsequent compiler errors.warning: TypeSystemSwiftTypeRef::GetNumChildren: had to engage SwiftASTContext fallback for type $syyXCD
I've also attached the script that I am using for authentication, this script runs on the first scene.
GameCenterManager.cs
在正常游戏中,如果非常频繁的调用assetBundle.Unload接口,会导致游戏应用画面卡死,但是游戏的背景音乐仍然正常播放。这类问题仅发生在iphone16 和iphone17的手机上,低版本的手机没有任何问题,请问该如何解决这个问题?
Hey, i have created a game in unity with the apple core and apple gamekit plugins present. I setup 5 leaderboards on the app store connect. I made a unity build and did the whole testflight build loop to test everything. When i open my gamecenter panel via the button i see my leaderboards but they show as MISSING TITLE which is weird because i have for sure set them up correctly they have a leaderboard reference name and leaderboard id as well. When debugging i can see that when i call my submit score function it gets submitted with no error but then i also dont see the score appear anywhere .
Keep in mind the leaderboards are not live and are being tested on testflight first
After running build.py -p Core GameKit and adding the tar balls to the Unity project in Assets/ExternalPackages no packages seem to be found when running the build using our continuous integration system.
This was not the case when the project was opened in the Editor.
It looks like in Apple.Core, the ApplePluginEnvironment hasn't run the OnEditorUpdate function and so the _appleUnityPackages Dictionary is empty.
A change to ApplePlugInEnvironment.cs seemed to fix the issue:
public static AppleNativeLibrary GetLibrary(string packageDisplayName, string appleBuildConfig, string applePlatform)
{
// ?FIX?: If we're not in the editor, we might not have updated the package list.
if (_appleUnityPackages.Count == 0 && _updateState == UpdateState.Initializing)
{
OnEditorUpdate(); // UpdateState.Initializing
OnEditorUpdate(); // UpdateState.Updating
}
I'm not sure if this is something we're doing incorrectly, the documentation for the plug-in mostly covered building the package.
We are trying to implement saving and fetching data to and from iCloud, but it have some problems.
MacOS: 15.3
Here is what I do:
Enable Game Center and iCloud capbility in Signing & Capabilities, pick iCloud Documents, create and select a Container.
Sample code:
void SaveDataToCloud( const void* buffer, unsigned int datasize, const char* name )
{
if(!GKLocalPlayer.localPlayer.authenticated) return;
NSData* data = [ NSData dataWithBytes:databuffer length:datasize];
NSString* filename = [ NSString stringWithUTF8String:name ];
[[GKLocalPlayer localPlayer] saveGameData:data withName:filename completionHandler:^(GKSavedGame * _Nullable savedGame, NSError * _Nullable){
if (error != nil)
{
NSLog( @"SaveDataToCloud error:%@", [ error localizedDescription ] );
}
}];
}
void FetchCloudSavedGameData()
{
if ( !GKLocalPlayer.localPlayer.authenticated ) return;
[ [ GKLocalPlayer localPlayer ] fetchSavedGamesWithCompletionHandler:^(NSArray<GKSavedGame *> * _Nullable savedGames, NSError * _Nullable error) {
if ( error == nil )
{
for ( GKSavedGame *item in savedGames )
{
[ item loadDataWithCompletionHandler:^(NSData * _Nullable data, NSError * _Nullable error) {
if ( error == nil )
{
//handle data
}
else
{
NSLog( @"FetchCloudSavedGameData failed to load iCloud file: %@, error:%@", item.name, [ error localizedDescription ] );
}
} ];
}
}
else
{
NSLog( @"FetchCloudSavedGameData error:%@", [ error localizedDescription ] );
}
} ];
}
Both saveGameData and fetchSavedGamesWithCompletionHandler are not reporting any error, when debugging, saveGameData completionHandler got a nil error, and can get a valid "savedGame", but when try to rebot the game and use "fetchSavedGamesWithCompletionHandler" to fetch data, we got nothing, no error reported, and the savedGames got a 0 length.
From this page https://developer.apple.com/forums/thread/718541?answerId=825596022#825596022
we try to wait 30sec after authenticated , then try fetchSavedGamesWithCompletionHandler, still got the same error.
Checked:
Game Center and iCloud are enabled and login with the same account.
iCloud have enough space to save.
So what's wrong with it.
Hi I have attempted to find a fix for my issue via documentation online and one phone support ( not code level support ) call to no end. I could continue to try various things but would like to see if someone else has encountered this issue and a fix for it.
Background: My Game app is live on App Store and has 1 classic leaderboard . I am now getting ready to submit an update to the app and it also entails adding a new recurring leaderboard. I added the leaderboard in App Store. I however have NOT uploaded my new build yet. I have also not added my leaderboards ( currently live and not live ) to any set.
When I try to submit scores using
GKLeaderboard.submitScore(_:context:player:leaderboardIDs:completionHandler:) to the new non-live leaderboard it works ( gives me no error )
When I try to load the scores from the new non-live leaderboard
GKLeaderboard.loadLeaderboards(IDs:completionHandler:)
loadEntries(for:timeScope:range:completionHandler:)
it fails. Error: "leaderboardID not found"
I could try ( and will )
uploading the new build to AppStore connect and associating the new leaderboard to it before testing again.
try associating each leaderboard to a set
Is there anything else that I should be aware of ?
Thanks in advance
Hello,
We are working on a real-time 2-player online game targeting multiple Apple devices. The following issue only occurs on tvOS:
When selecting matchmaking to connect with another player, the native Game Center interface opens and begins the matchmaking process.
Almost immediately, the following log appears in the console, and the matchmaking screen remains indefinitely without completing:
Timeout while starting matching with request: <GKMatchRequestInternal 0x30d62f690> {
defaultNumberOfPlayers : 0
isLateJoin : 0
localPlayerID : U:bea182d69b85f0839e3958742fbc4609
matchType : 0
maxPlayers : 2
minPlayers : 2
playerAttributes : 4294967295
playerGroup : 1
preloadedMatch : 0
recipientPlayerIDs : <__NSArrayM 0x3034ed5c0> {}
recipients : <__NSArrayM 0x3034ee280> {}
restrictToAutomatch : 0
version : 1
archivedSharePlayInviteeTokensFromProgrammaticInvite, inviteMessage, localizableInviteMessage, messagesBasedRecipients, properties, queueName, recipientProperties, rid, sessionToken : (null)
} . Error: (null)
However, the task does not complete when the log appears (our Debug.Log are nerver called).
But if we manually cancel the matchmaking process, the "User cancel" log is correctly triggered.
Here is a code snippet for the request :
var gkMatchRequest = GKMatchRequest.Init();
gkMatchRequest.MinPlayers = 2;
gkMatchRequest.MaxPlayers = 2;
var matchRequestTask = GKMatchmakerViewController.Request(gkMatchRequest);
matchRequestTask.ContinueWith(t => { Debug.LogException(t.Exception); }, TaskContinuationOptions.OnlyOnFaulted);
matchRequestTask.ContinueWith(t => { Debug.LogInfo("User cancel"); }, TaskContinuationOptions.OnlyOnCanceled);
matchRequestTask.ContinueWith(t => { Debug.LogInfo("Success"); }, TaskContinuationOptions.OnlyOnRanToCompletion);
We have tested this on multiple devices and network types (Wi-Fi, 5G, Ethernet), but we consistently encounter this bug along with the same log message.
Could you please help us understand or resolve this issue?
Thank you.
When testing my development build for gamecenter authentication, the game crashes. I've breadcrumbed it to the "await GKLocalPlayer.Authenticate();" call. Can't find any documentation on this issue and have been looking through the forums!
I've already done all of the usual stuff like verifying bundle identifiers match, ensuring game center is enabled for the app, setting up app store connect, using a sandbox account, etc...
Please point me to some resources if you know any. Any help is appreciated, I'm starting to lose hope here!
New to achievements. I added them in App Store Connect and want to test them.
Apple Documentation says this:
"Before you begin testing your GameKit configuration, you need to enable Debug Mode. In Xcode, choose Product > Scheme > Edit Scheme. From the Run configuration, select Options and toggle Enable Debug Mode.
To begin testing your achievement configuration, open the game Progress Manager. In Xcode, choose Debug > GameKit > Manage Game Progress."
Sounds easy enough, but there is no "GameKit" under Debug in Xcode 16.2.
Topic:
Graphics & Games
SubTopic:
GameKit