I am currently working on a game that involves earning achievements, which I am using the Apple Unity Plug-Ins to display. I have found that occasionally opening the Game Center Dashboard the last achievement earned will not be displayed until the game is closed and reopened. I am using GKAccessPoint.Shared.Trigger to display the Achievements screen, which occasionally seems to open a cached version of the dashboard. I've found that it seems to consistently happen when earning multiple achievements within one minute, but this is not always the case. Does anybody have any experience with something like this in the past?
GameKit
RSS for tagCreate apps that allow players to interact with each other using GameKit.
Post
Replies
Boosts
Views
Activity
Hi all im having a variety of issues with gamekit matchmaking. On the simulator the matchmaking ui pops up and I can click Quick Match, then immediately "Failed to find Players" this is the same with a real Apple ID and a sandbox account.
If I use real devices the app at least discovers a match, but then the match none of the delegate methods for the match ever get called and the logs are filled with socket not connected and various errors.
My questions are:
Should match making via quick match work in the simulator, I have seen tutorial videos etc of this working, but I can't seem to get it to work.
How do people debug issues with GameCenter / Gamekit to find out why its not able to connect?
Many thanks in advance
The solo Leveling:arise is a game but the game mode is not switching on and game crashing everything time while playing
I play this game called Sonic Forces: Speed Battle that's available in the app store and I completed a quest outside of the app on this site called TapResearch for some rewards as I've done before and has worked, but after this one time I can no longer enter back into the game without crashing immediately. I tried deleting and reinstalling but nothing. I even tried signing into a different account but that didn't work either. So then I tried to make a new game center account to try and see if it works, and it did, though all my progress has been restarted. Does anyone know how to fix this?
I’ve added two recurring leaderboards to my app and the user interface for the Game Center leaderboards pops up when expected and it lists the leaderboards but when you click on them it says “Have Fun With Friends” and lists some of my contacts instead of any scores. The status under Apple Connect is “Not Live” and I’m wondering how to activate them. App has been approved for external beta testing. On a related note, on my iPad it doesn’t display correctly, it says “Game Center” at the top but the rest of the UI doesn’t appear, just blackness.
Hello, I’m the developer of the “ StepSquad” app. Our app uses the Game Center achievement feature, but we’ve been encountering a problem: the “Global Players” metric always shows 0%, even though there are friends who have already achieved these achievements. Initially, I thought it might be because the app was newly launched. However, it’s now been over two months since release, and it’s still showing 0%. If anyone has any insight into this issue, please leave a comment.
Hello, I’m the developer of the “stepsquad” app. Our app uses the Game Center achievement feature, but we’ve been encountering a problem: the “Global Players” always shows 0%, even though there are friends who have already achieved these achievements. Initially, I thought it might be because the app was newly launched. However, it’s now been over two months since release, and it’s still showing 0%. If anyone has any insight into this issue, please leave a comment.
I'm trying to add support to PS5 DualSense controller.
when I try to use the API from here:
https://developer.apple.com/documentation/gamecontroller/gcdualsenseadaptivetrigger?language=objc
None of the API works, am I missed anything?
The code is like this:
if ( [ controller.extendedGamepad isKindOfClass:[ GCDualSenseGamepad class ] ] )
{
GCDualSenseGamepad * dualSenseGamePad = ( GCDualSenseGamepad * )controller.extendedGamepad;
auto funcSetEffectTrigger = []( TriggerEffectParams& params, GCDualSenseAdaptiveTrigger *trigger ) {
if ( params.m_mode == TriggerEffectMode::Off )
{
[ trigger setModeOff ];
NSLog(@"setModeOff trigger.mode:%d", trigger.mode );
}
else if ( params.m_mode == TriggerEffectMode::Feedback )
{
[ trigger setModeFeedbackWithStartPosition: 0.2f resistiveStrength: 0.5f ];
}
else if ( params.m_mode == TriggerEffectMode::Weapon )
{
[ trigger setModeWeaponWithStartPosition: 0.2f endPosition: 0.4f resistiveStrength: 0.5f ];
}
else if ( params.m_mode == TriggerEffectMode::Vibration )
{
[ trigger setModeVibrationWithStartPosition: position amplitude: amplitude frequency: frequency ];
}
};
if ( L2 )
{
funcSetEffectTrigger( params, dualSenseGamePad.leftTrigger );
}
if ( R2 )
{
funcSetEffectTrigger( params, dualSenseGamePad.rightTrigger );
}
}
I've also tested to add "Game Controllers" capability to Target, still not working.
Can't find anything else from the document or forums.
I've no idea what need to do.
I am developing a turn based game using GameKit. The happy path (pretty much as always) is fine; invite, accept, play, have winners/losers and match ends. Yay! But I am working on making sure I handle situations where invited friends decline to participate.
I've been through the docs, and don't see how the GKTurnBasedMatch is updated to reflect the tap of the decline button in the Game Center Invite notification. When I reload the match from Game Center on the host device the status for the invitee who declined is still .invited.
I also tested by setting all players that are not the host in the nextParticipants of the endTurn(...) to start the invites and the next invitee was not given a push notification to accept or decline the invite.
I feel like there should be a way to determine when an invitee has declined an invite (via participant in the match.participants via status OR a delegation method somewhere that is called when the Decline or Accept buttons on that notification are tapped.)
I'm missing something, please help me find it!
Thank you!
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.
I'm making the following call:
[[GKGameCenterViewController alloc] initWithLeaderboardID:leaderboardID playerScope:(GKLeaderboardPlayerScopeGlobal) timeScope:(GKLeaderboardTimeScopeAllTime)];
When I present that VC, I get the correct leaderboard (for my passed leaderboardID), but it appears in "Friends" view, not "Global". Global works fine when I tap on it, but I'd like to display that list by default. Seems like a pretty straightforward request supported by the API. Does initWithLeaderboardID not respect that? I'm curious if others have this problem. Thanks!
Hi. The earliest version of MacOS that Unity supports is 10.13. However, it seems that running a game using Unity Plugins on 10.13 causes DLL loading exceptions whenever you try to access part of the GameKit API. The errors look like this:
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/GameKitWrapper
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/libGameKitWrapper.dylib
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/libGameKitWrapper.dylib
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/libGameKitWrapper.so
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/libGameKitWrapper.bundle
DllNotFoundException: GameKitWrapper assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) Apple.GameKit.DefaultNSErrorHandler+Interop.DefaultNSErrorHandler_Set(Apple.Core.Runtime.NSExceptionCallback)
at Apple.GameKit.DefaultNSErrorHandler.Init () [0x00001] in ./Library/PackageCache/com.apple.unityplugin.gamekit@e3d4ad5a2c8e/Source/DefaultHandlers.cs:35
(Filename: ./Library/PackageCache/com.apple.unityplugin.gamekit@e3d4ad5a2c8e/Source/DefaultHandlers.cs Line: 35)
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/GameKitWrapper
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/libGameKitWrapper.dylib
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/libGameKitWrapper.dylib
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/libGameKitWrapper.so
Fallback handler could not load library /Users/love/Desktop/REDACTED/Contents/Frameworks/MonoEmbedRuntime/osx/libGameKitWrapper.bundle
DllNotFoundException: GameKitWrapper assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) Apple.GameKit.DefaultNSExceptionHandler+Interop.DefaultNSExceptionHandler_Set(Apple.Core.Runtime.NSExceptionCallback)
at Apple.GameKit.DefaultNSExceptionHandler.Init () [0x00001] in ./Library/PackageCache/com.apple.unityplugin.gamekit@e3d4ad5a2c8e/Source/DefaultHandlers.cs:14
These errors do not appear on 10.15 or later, which is why I am assuming it's a problem with this particular version of MacOS. Have not been able to test 10.14 so not sure how it handles there.
So, here is my question - what is the earliest version of MacOS that the Apple Unity plugins support? It's not documented anywhere on the GitHub page.
// Love
Hi, I’m creating a game and I’m just wondering if I can integrate GCVirtualController in my SwiftUI app.
So recently I have been trying to install game-porting-toolkit, and when I try to run
brew -v install apple/apple/game-porting-toolkit
Im getting an error:
Error: apple/apple/game-porting-toolkit 1.1 did not build
Logs:
/Users/mateusz/Library/Logs/Homebrew/game-porting-toolkit/00.options.out
/Users/mateusz/Library/Logs/Homebrew/game-porting-toolkit/01.configure
/Users/mateusz/Library/Logs/Homebrew/game-porting-toolkit/01.configure.cc
/Users/mateusz/Library/Logs/Homebrew/game-porting-toolkit/wine64-build
If reporting this issue please do so to (not Homebrew/brew or Homebrew/homebrew-core):
apple/apple
I searched on this forum some threads but I couldn't take any advice from them. I would really appreciate any help.
In my SceneKit game I'm able to connect two players with GKMatchmakerViewController. Now I want to support the scenario where one of them disconnects and wants to reconnect. I tried to do this with this code:
nonisolated public func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) {
Task { @MainActor in
switch state {
case .connected:
break
case .disconnected, .unknown:
let matchRequest = GKMatchRequest()
matchRequest.recipients = [player]
do {
try await GKMatchmaker.shared().addPlayers(to: match, matchRequest: matchRequest)
} catch {
}
@unknown default:
break
}
}
}
nonisolated public func player(_ player: GKPlayer, didAccept invite: GKInvite) {
guard let viewController = GKMatchmakerViewController(invite: invite) else {
return
}
viewController.matchmakerDelegate = self
present(viewController)
}
But after presenting the view controller with GKMatchmakerViewController(invite:), nothing else happens. I would expect matchmakerViewController(_:didFind:) to be called, or how would I get an instance of GKMatch?
Here is the code I use to reproduce the issue, and below the reproduction steps.
Code
Run the attached project on an iPad and a Mac simultaneously.
On both devices, tap the ship to connect to GameCenter.
Create an automatched match by tapping the rightmost icon on both devices.
When the two devices are matched, on iPad close the dialog and tap on the ship to disconnect from GameCenter.
Wait some time until the Mac detects the disconnect and automatically sends an invitation to join again.
When the notification arrives on the iPad, tap it, then tap the ship to connect to GameCenter again. The iPad receives the call player(_:didAccept:), but nothing else, so there’s no way to get a GKMatch instance again.
Hi,
I have a test app with a single "game centre achievement" and I am running it on my iPad and unable to list that achievement with
GameCenterManager.shared.loadAchievements
The app is still in version 1.0, prepare for submission status, (it is not ready for review submission). Game Center entitlement is added for the app and the achievement is added to the Game Center section of app. However it is marked as NotLive.
I am using a sandbox account to login to game centre on the iPad and I can't fetch this achievement. Is it because it is "NotLive". ? How do I test my Game Center achivement on the device without releasing it yet.
GKGameCenterViewController won't turn off.
With Core and GameKit from GitHub apple/unityplugins,
I succeeded in logging in and displaying GKGameCenterViewController.
Other leaderboards and everything work fine, but when I press X on GameCenter to return to the game, nothing happens.
I tried debugging by printing logs here and there in the plugin to check, but I didn't get any results.
When I press X, I couldn't get any logs or responses. It was like a button with no listener attached. No, it was more like an image.
Based on the community posts that said it worked fine before, it seems that the recent GameCenter update was not applied to the plugin, was omitted, or changed, causing a mismatch.
Hi,
I tried to save the game progress using the official Apple plugin for Unity but the crash happened when I active the "iCloud Documents" inside capabilities and when deactivated it this error message appeared:
Code=27 Domain=GKErrorDomain Description=The requested operation could not be completed because you are not signed in to iCloud or have not enabled iCloud Drive. (UbiquityContainerUnavailable)
Authentication with Game Center works fine using the Core plugin, but nothing works correctly when I use the GameKit plugin.
Note:
I already active iCloud for app Identifier.
Tichnecal informations:
Unity version: 2022.3.47f1 LTS
XCode 16
Swift 6
GameKit-3.0.0 (Apply unity plugin)
Core-3.1.5 (Apply unity plugin)
I'm displaying a GKGameCenterViewController after successfully authenticating and on iOS 18.0 and 18.1, I get a black screen. As a sanity check GKLocalPlayer.local.isAuthenticated is also returning true. The same code works just fine on iOS 17. Is there something that needs to be done on iOS 18 and above?
I'm sure this question was asked many times before but I cannot find a good answer. In my case it just doesn't work.
Here's what I did
Created a couple of test user accounts on appstore connect under the sandbox section.
Launched two different simulators via xcode. On each simulator I logged in into test icloud account and game center accordingly.
Deployed and launched my code via xcode.
What happens is that GameKit code fails to find any peers no matter what I do. Sending Invite doesn't work either because the simulator displays an error message saying "you need to log-in into icloud account first" although it's already logged in. I tried the same code on two different physical devices with two real icloud accounts and it works as expected but it's not a viable path to develop and debug an app. I'm using the latest Xcode 16.1 running on 15.1.
Anybody has any clue how to solve this ?