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

GameKit Documentation

Post

Replies

Boosts

Views

Activity

Controller Input Not Working in HappyBeam Sample
I'm working on an Immersive game that requires Controller input. The Happy Beam sample is supposed to support hand tracking and controller input. I have tested the controller input with a PS5 Dual Sense controller and all I can do is move around the scene while the game plays. But cannot interact with anything in the scene. Can anyone confirm this and or suggest how I can use a controller in an immersive space? I cannot find a single working example.
1
0
754
Aug ’23
Not imported Metal but getting these errors!
Device : iPhone 13 Pro, iOS 17 Beta 5. Xcode : Both 14.3.1 and 15 Beta 5 My app is crashing for no reason after a touch gesture on my device, but it's working fine on a simulator. I have used GameKit but not imported Metal or SpriteKit. I'm getting these errors. CleverJacks[791:45451] Metal API Validation Enabled -[MTLDebugRenderCommandEncoder setRenderPipelineState:]:1615: failed assertion `Set Render Pipeline State Validation For color attachment 2, the render pipeline's pixelFormat (MTLPixelFormatRGBA16Float) does not match the framebuffer's pixelFormat (MTLPixelFormatR16Float). the pipelineState's per sample imageBlock usage(14) is greater than the encoder's perSample imageBlock usage(8)
1
1
586
Aug ’23
Reset GameCenter scores
Is it possible to remove/reset GmeCenter scores for my game app? I'd like to remove all scores so new users can start to compete. Is this possible? The games are educationally based and I'fd like to reset score for a new class.
0
0
414
Aug ’23
How to manage GKGameCenterViewController with app lifecycle?
What should an app do with an instance of GKGameCenterViewController when the app transitions to the background? Currently, my app just leaves it in place, displayed on top in full screen. Most of the time when my app resumes to the foreground, the GKGameCenterViewController is still displayed and is functional. However, sometimes when the app resumes, the GKGameCenterViewController's view has vanished and, additionally, my app doesn't receive a GK authentication event, so effectively it is "hung". This seems to happen most often when the app has been in the background a while, such as overnight. The app is still in memory, however, not starting cold. I would like to leave the GKGameCenterViewController/view in place when the app is backgrounded since the player may return to the game quickly and be right back where they left off. And most of the time that works. However, I need to solve the problem for the times it doesn't as I described above. Is there any guidance on what to do with a GKGameCenterViewController (or any GK controller for that matter) when an app goes into the background?
0
0
410
Aug ’23
Game Center Login Notification Displayed at Top in the App
In the app, when logged into Game Center and moving the app to the background and then returning to the foreground, the Game Center login message is displayed at the top every time. Before iOS 17, this message was only shown at the initial login and app launch. However, from iOS 17, this message is displayed during the transition from background to foreground. Is this an intended feature or a bug?
0
0
400
Sep ’23
Game Center and App transfer
We transferred application, using guide there: https://developer.apple.com/help/app-store-connect/transfer-an-app/overview-of-app-transfer/ We use Game Center to identify users via playerid https://developer.apple.com/documentation/gamekit/gkplayer/1521127-playerid After transferring application playerid for our current users is changed, and so users are unable to login How can we restore playerid for our users? For "Sign in with Apple" there are migration process, so there are no issues, is there something like that for Game Center?
1
1
493
Oct ’23
[GPTK] Unity game controller support
While my GPTK setup works fine with games like Rocket League, any Unity made game will freeze when a joystick input is given. I've tested this with 'Zeepkist' and 'Engine Evolution 2021', both have full steam controller support enabled. If I run the GPTK game in foreground, right after moving the joystick, this error is logged: 0bac:fixme:rawinput:rawinput_from_hardware_message Unhandled rawinput type 0x100 This only happens when Steam is running. For example, running the 'Zeepkist' .exe manually while Steam is NOT RUNNING, the controller works fine! Most of the time this results in a crash throwing: 0bbc:fixme:dbghelp:SymLoadModuleExW Unsupported Flags 00000005 for (null) 0bbc:fixme:dbghelp:SymLoadModuleExW Unsupported Flags 00000005 for (null) 0bbc:fixme:dbghelp:SymRegisterFunctionEntryCallback64 (0000000000000084 0000000140036E50 2508e0): stub! wine: Unhandled page fault on read access to 0000001BFFFFFFE4 at address 000000006E73B991 (thread 0bac), starting debugger... 0bbc:fixme:file:CancelSynchronousIo (000000000000007C): stub 0810:fixme:imm:ImeSetActiveContext (0x36ed10, 1): stub 0810:fixme:imm:ImmReleaseContext (000000000009020A, 000000000036ED10): stub I would love to play Unity games using GPTK. Please suggest any tips/tricks to resolve this issue.
0
0
789
Oct ’23
Game Controller Framework for visionOS Apps
Hi, I was working on implementation of game controller input to my game. I've connected my Xbox controller and tried to do a test and it is working in an macOS application. I wanted to port it to my visionOS app but the app can't seem to recognize my gamepad inputs. But visionOS simulator can recognize because it is changing camera by gamepad input. According to documentation GCController functions supports visionOS. Do the apps directly supports GC input? Or do I make mistake in my code? Thanks
2
0
732
Oct ’23
Unable to upload Game Center Achievement Image using API
I attempted to use the new App Store Connect API 3.0 feature to manage Game Center achievements. My goal was to create a bunch of achievements, with one en-US localization each, with an attached image. Creating the achievement and its localization initially seems to have worked fine; I uploaded the image, and its assetDeliveryState.state is COMPLETED. But when I visit the achievement in the App Store Connect Console UI, all the images I've uploaded are 404 Not Found. I'm going to have to upload all of these images by hand. 😭 Here's the sample code I used, using the https://github.com/dfabulich/node-app-store-connect-api v5.0.3. import { api } from 'node-app-store-connect-api'; import { readFile, stat } from 'node:fs/promises'; import { homedir } from 'node:os'; const appId = 6468677114; const vendorIdentifier = 'com.example.myachievement'; const showBeforeEarend = true; const points = 10; const locale = "en-US"; const title = "My Achievement"; const afterEarnedDescription = "Earned the achievment."; const beforeEarnedDescription = "Earn the achievement."; const fileName = `${vendorIdentifier}.png`; const params = { issuerId: "69a6de6f-0d6d-47e3-e053-5b8c7c11a4d1", apiKey: "3S3G8T48YW", }; params.privateKey = await readFile(`${homedir()}/.appstoreconnect/private_keys/AuthKey_${params.apiKey}.p8`, 'utf8'); const { read, create, uploadAsset, pollForUploadSuccess } = await api(params); const {data: gameCenterDetail} = await read(`apps/${appId}/gameCenterDetail`); console.log('creating', vendorIdentifier); const gameCenterAchievement = await create({ type: 'gameCenterAchievements', attributes: { referenceName: title, vendorIdentifier, points, repeatable: false, showBeforeEarned, }, relationships: { gameCenterDetail } }); console.log(' localization'); const gameCenterAchievementLocalization = await create({ type: 'gameCenterAchievementLocalizations', attributes: { locale, name: title, afterEarnedDescription, beforeEarnedDescription, }, relationships: { gameCenterAchievement } }); console.log(' image'); const image = await create({ type: 'gameCenterAchievementImages', attributes: { fileName, fileSize: (await stat(fileName)).size, }, relationships: { gameCenterAchievementLocalization } }); console.log(' upload'); await uploadAsset(image, await readFile(fileName)); console.log(' poll'); await pollForUploadSuccess(image.links.self);
6
0
744
Nov ’23
Multiplayer testing with Game Center and IOS simulator
I am trying to test game center multiplayer with the IOS simulator and my physical phone. I can get it working between 2 physical phones but whenever I try with the simulator it shows the error Failed to find players. I have seen people use the simulator before to test multiplayer. I have tried both my account and a sandbox account with no luck. Is there something I am missing or doing wrong? I am using gamekit to make this app. Thanks
0
0
378
Nov ’23
GameKit - iCloud Sign In Error
Hi everyone, I'm trying to implement matchmaking in visionOS using GameKit and GameCenter. I'm following the example project that been shared but I get an error. Error: The requested operation could not be completed because you are not signed in to iCloud.. I'm getting this error as a result of matchmaking. I'm already logged in to iCloud in Vision Pro Simulator. I've tried to switch off-on every related settings but didn't work. I'm using latest Xcode Dev Beta and visionOS Beta v6. Would you mind share me any workaround? Regards, Melih
3
0
784
Nov ’23
Bluetooth Low Energy HID Gamepad PnP not accepted by iOS devices
Dear support We are developing a Bluetooth Low Energy HID Gamepad and are having issues connecting it to iOS devices (iPhone). Pairing is always successful. The issue is related to the PnP ID used. If we use a PnP ID for a gamepad currently on the market - like a Google Stadia - there is no issue. The Gamepad connects (pairs) with the iPhone and is recognised in the iPhone "settings->general->game controller" Also if a "Game Controller Tester" APP is installed on the iPhone this works ok. If we use our own PnP the Gamepad connects (pairs) but iPhone does not recognise it in "settings->general->game controller" . Also the "Game Controller Tester" APP does not work. The question is :- Is there something we need to do with our own PnP for it to be recognised by iOS devices. For info - on Android and Windows our PnP is recognised ok - we can control a Game Controller APP with it. The issue is only with Apple iOS devices. Any help would be welcome. Thanks JESP
4
0
791
Nov ’23
Leaderboards for development and live environments
Hello, I'm working on a game application and I've been wondering about how I can separate the GameKit Leaderboards I'm using for testing purpose and the ones that would be "live" (i.e: only for the users) I've been point out that I can attach leaderboards to an app version but it makes me wondering about compatibility. I'm working on the application in version 1.1. My users are using the application in version 1.0 (with their leaderboards). Then I'm releasing a version 1.2. It would means I need to attach all the leaderboards from version 1.0 to version 1.2 and to me it's very tedious. What would be the best practice with using leaderboards on multiple environments? Thanks
0
0
362
Nov ’23
[VisionOS] Crash on Present / Show GameCenter UI on VisionOS
I'm trying to display the native GameCenter interface from Unity (I've already tried Bounded and Unbouded Volume Mode, that is, with and without Full Immersive Mode) but I can't display this interface. If I use Unity's SocialAPI (https://docs.unity3d.com/ScriptReference/Social.ShowLeaderboardUI.html), nothing is displayed, and I get the following message in XCode (simulator): [u 9C225095-F55E-42CC-8136-957279631DF3:m (null)] [com.apple.GameCenterUI.GameCenterDashboardExtension(1.0)] Connection to plugin interrupted while in use. setViewControllers:animated: called on <GKGameCenterViewController 0x106825600> while an existing transition or presentation is occurring; the navigation stack will not be updated. Type: Notice | Timestamp: 2023-12-08 12:13:50.585973+01:00 | Process: leaderboard-test | Library: UIKitCore | TID: 0x3e57bd viewServiceDidTerminateWithError:: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted} Type: Notice | Timestamp: 2023-12-08 12:13:50.586997+01:00 | Process: leaderboard-test | Library: UIKitCore | TID: 0x3e57bd [u 9C225095-F55E-42CC-8136-957279631DF3:m (null)] [com.apple.GameCenterUI.GameCenterDashboardExtension(1.0)] Connection to plugin invalidated while in use. Type: Error | Timestamp: 2023-12-08 12:13:50.588393+01:00 | Process: leaderboard-test | Library: PlugInKit | Subsystem: com.apple.PlugInKit | Category: lifecycle | TID: 0x3e5a18 If I try to do it using Apple's plugin for GameCenter (GameKitWrapper) adapted to VisionOS, the application crashes with the following error: "Presentations are not permitted within volumetric window scenes." *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Presentations are not permitted within volumetric window scenes.' *** First throw call stack: ( 0 CoreFoundation 0x00000001804a510c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x0000000180082f50 objc_exception_throw + 56 2 UIKitCore 0x0000000184bc2798 -[UIViewController _presentViewController:withAnimationController:completion:] + 1136 3 UIKitCore 0x0000000184bc4000 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 88 4 UIKitCore 0x0000000184bc42d0 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 484 5 UIKitCore 0x0000000184bc3f6c -[UIViewController _presentViewController:animated:completion:] + 160 6 UIKitCore 0x0000000184bc4374 -[UIViewController presentViewController:animate *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Presentations are not permitted within volumetric window scenes.' *** First throw call stack: ( 0 CoreFoundation 0x00000001804a510c __exceptionPreprocess + 172 1 libobjc.A.dylib 0x0000000180082f50 objc_exception_throw + 56 2 UIKitCore 0x0000000184bc2798 -[UIViewController _presentViewController:withAnimationController:completion:] + 1136 3 UIKitCore 0x0000000184bc4000 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 88 4 UIKitCore 0x0000000184bc42d0 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 484 5 UIKitCore 0x0000000184bc3f6c -[UIViewController _presentViewController:animated:completion:] + 160 6 UIKitCore 0x0000000184bc4374 -[UIViewController presentViewController:animated:completion:] + 140 7 GameKitWrapper 0x00000001057aa864 $s14GameKitWrapper34GKGameCenterViewController_Present7pointer6taskId9onSuccessySv_s5Int64VyAGXCtF ... ) The code that produces this crash is the following (trying to display the GameCenter UI): let viewController = UIApplication.shared.windows.first!.rootViewController; viewController?.present(target, animated: true); @_cdecl("GKGameCenterViewController_Present") public func GKGameCenterViewController_Present ( pointer: UnsafeMutableRawPointer, taskId: Int64, onSuccess: @escaping SuccessTaskCallback ) { let target = Unmanaged<GKGameCenterViewController>.fromOpaque(pointer).takeUnretainedValue(); _currentPresentingGameCenterDelegate = GameKitUIDelegateHandler(taskId: taskId, onSuccess: onSuccess); target.gameCenterDelegate = _currentPresentingGameCenterDelegate; #if os(iOS) || os(tvOS) || os(visionOS) let viewController = UIApplication.shared.windows.first!.rootViewController; viewController?.present(target, animated: true); #endif } Is there a way to present the GameCenter UI overlaid on the Unity app?
1
1
797
Dec ’23