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!
The update to iOS 26 is naturally absolutely crucial for this to work, I don't know why I expected the new Activity functionality to run on iOS 18.6..
Sorry about this, a very avoidable mistake on my end, especially with that very clear reason given with the exception.