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

GameKit Documentation

Post

Replies

Boosts

Views

Activity

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
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
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
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
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
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
[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 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
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
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
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
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
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
Is GKLocalPlayer's gamePlayerID different from the gamePlayerID other players in the GKMatch can access/see?
I'm trying to make a real-time peer-to-peer multiplayer game with GameKit/Game Center. I'm trying to store a dictionary of player IDs and scores ([String:Int]) to keep track of and share player scores during a game. Essentially, I want to be able to increment the score of a player locally, then send the updated scores dictionary to all the other players. However, the GKLocalPlayer.local.gamePlayerID seems to be in a completely different format than any other connected GKPlayer, so when I try to access the GKMatch.players with the gamePlayerID, it isn't found (and yes, I'm aware that GKMatch.players doesn't contain the local player). The GKPlayer has an 18-digit long integer, whereas the GKLocalPlayer has A:_ and then a long hexadecimal number (I think it's 37 digits in decimal). Can someone explain this difference or point to some resources that explain how I can implement this functionality correctly? Here's a simplified example of what I'm doing: var scores: [String:Int] // dictionary of [gamePlayerID:Score] scores[myMatch.players.first.gamePlayerID] = 3 scores[GKLocalPlayer.local.gamePlayerID] = 5 sendScores(scores) // sends data to all players using myMatch.sendData() /* When the receiving players decode and try to access scores[gamePlayerIDOfSendingPlayer], it isn't found because it's different from that player's gamePlayerID in the receiving player's GKMatch.players array */
1
1
409
Aug ’23
GameKit Unity Sample works in Editor but not Player
I've build the Apple Unity plugins and added them to my Unity project. I've also loaded up the Apple.GameKit 1.0.4 GameKit Demo Scene. When I run this scene in the Unity editor, I get the prompt to select my Game Center account, and the username appears in the Editor Game window UI. From here, the other on-screen buttons work as well, I can pull up the Game Center Achievements window or the Realtime Matchmaking UI. If I build this project for macOS, and run the resulting app on the Mac, it isn't working. On the game UI, the "Local Player Name" text never updates to show the username of my GameCenter account. None of the on screen buttons work, nothing happens when clicked. If I build from unity for macOS with debug on, I can attach a debugger while running the app. If I do this, and add breakpoints, it seems that the application hits the first line from the Start() function of GameKitSample.cs : _localPlayer = await GKLocalPlayer.Authenticate(); But execution never seems to get past this point. It also doesn't seem to throw any exception. It just gets stuck here and I can't use any Game Kit features in the sample scene. What is missing? The same code seems to interact with Game Center just fine while running from the Unity Editor.
0
0
734
Jul ’23