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

GameKit Documentation

Posts under GameKit tag

84 Posts
Sort by:
Post not yet marked as solved
0 Replies
1.3k Views
We have some problems with achievements which were unlocked in Game Center. This is our first time that we implemented Game Center features inside our app and it seems that leaderboards, score reporting and unlocking achievements are all working fine. We can see unlocked achievements in the achievements board but they are becoming locked again just a few seconds later. Everything seem to be working fine except this weird behavior (all handlers are returning success etc.) We also tried many tests with different type of achievements (both with achievable more than once YES and NO achievements). It may be an expected behavior with achievements which are of kind achievable more than once but they are becoming locked again if they are not as such) As the only thing that comes to our minds: the version with achievements and leaderboard is not published yet in AppStore and we are testing achievements with some sandbox testers and a real user device. Could such resetting (becoming locked again) be due to not yet being published in store? Thanks in advance for very appreciated tries, help and assistance If it will help you guide us: * GKAchievementDescription loadAchievementDescriptionsWithCompletionHandler: returns all achievement registered in appstore connect GKAchievement reportAchievements: always return success (and so we can see them in gamecenter board) GKAchievement loadAchievementsWithCompletionHandler: returns completed achievements until that reset occurs (i.e. after completing the achievement, we send a request -> it is there; a few seconds later again we send a request -> it is again there; a few more tries and it is gone ...)
Posted
by
Post not yet marked as solved
0 Replies
701 Views
I am getting 4 warnings compiling the current template of sceneKit game /Users/helmut/Documents/spaceTime/scntool:1:1 Could not find bundle inside /Library/Developer/CommandLineTools any idea why the bundle is not installed I did a new download twice now still stuck getting these warnings about bundles not installed or not found any solution to correct the download install so the base dependencies are present thank you
Posted
by
Post not yet marked as solved
0 Replies
788 Views
Previously art work used and porting a complex 3D mechanical Clock I am running into constant build errors using my previous art work .scn files I had some success converting my .usdz original to .scn file some convert but most just being in the art folder of the build environment cause this crash and are no longer compatible I use the same art work of gears and parts in UNITY build environment without any build issues most of my clocks have up to 35 different interacting parts These are replicas of classical clock mechanism Is any one else having problems with similar .scn files [?]
Posted
by
Post marked as solved
3 Replies
1.8k Views
I have a Unity project, after setting up Apple.Gamekit plugin, it show up some error when build with XCode: ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/mac/Documents/Bonex/BoneX_demo1/iOSBuild_demo2/Libraries/libiPhone-lib.a(unwind_test_arm64.o) Undefined symbols for architecture arm64: "_GKLocalPlayer_Authenticate", referenced from: _GKLocalPlayer_GKLocalPlayer_Authenticate_mA13EED25E9E6BC8EAA0DE8E36D389AC904B41435 in Apple.GameKit.o (maybe you meant: _GKLocalPlayer_GKLocalPlayer_Authenticate_mA13EED25E9E6BC8EAA0DE8E36D389AC904B41435, _GKLocalPlayer_Authenticate_m3BBD62A177560D3F93691F97581B484A6EBA0836 ) "_GKLocalPlayer_GetIsMultiplayerGamingRestricted", referenced from: _GKLocalPlayer_GKLocalPlayer_GetIsMultiplayerGamingRestricted_m347F15CBE262C877190B5C7F4B55AFAD595705D5 in Apple.GameKit.o (maybe you meant: _GKLocalPlayer_GKLocalPlayer_GetIsMultiplayerGamingRestricted_m347F15CBE262C877190B5C7F4B55AFAD595705D5) "_GKLocalPlayer_GetIsPersonalizedCommunicationRestricted", referenced from: _GKLocalPlayer_GKLocalPlayer_GetIsPersonalizedCommunicationRestricted_mB1E3D7AE957AAA19E6ABBDCDEAD9821B09EB1DC1 in Apple.GameKit.o (maybe you meant: _GKLocalPlayer_GKLocalPlayer_GetIsPersonalizedCommunicationRestricted_mB1E3D7AE957AAA19E6ABBDCDEAD9821B09EB1DC1) "_GKLocalPlayer_GetIsUnderage", referenced from: _GKLocalPlayer_GKLocalPlayer_GetIsUnderage_mF266E6F8AA10922F3B02ED3A877D3C403EA46045 in Apple.GameKit.o (maybe you meant: _GKLocalPlayer_GKLocalPlayer_GetIsUnderage_mF266E6F8AA10922F3B02ED3A877D3C403EA46045) "_NSError_Free", referenced from: _NSError_NSError_Free_m0AFB1ED4BF090D6E5276479A1F53680D4FD47A4A in Apple.Core.o (maybe you meant: _NSError_NSError_Free_m0AFB1ED4BF090D6E5276479A1F53680D4FD47A4A) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) The plugin I added, which is provided by Apple: https://github.com/apple/unityplugins My : build appunityplugin used 2020.3.33f1 XCode to version 14.3.1 Please help! Thank you!!!
Posted
by
Post not yet marked as solved
1 Replies
849 Views
We are upgrading our ObjC-based iOS multiplayer game to Unity, so we plan to use the Unity Apple plugins. Specifically, we want to use Apple.Core and Apple.Gamekit packages. Cloned the project from https://github.com/apple/unityplugins Built the package using Unity 2020.3.33f1 In the Unity Editor, used Windows > Package Manager and added both packages from the tarball. No errors; all looks good. 5, Built & Run the project and installed the game on an iPhone 13 device. 6. Once the game starts, we see the following errors, and the game quits. Errors: '/private/preboot/Cryptexes/OS/usr/lib/swift/AppleCoreNative.framework/AppleCoreNative' (no such file), '/private/var/containers/Bundle/Application/0CF8E689-36C1-4AA6-9CF6-1E078EC1A3FB/Game.app/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file), '/private/var/containers/Bundle/Application/0CF8E689-36C1-4AA6-9CF6-1E078EC1A3FB/Game.app/Frameworks/UnityFramework.framework/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file), '/private/var/containers/Bundle/Application/0CF8E689-36C1-4AA6-9CF6-1E078EC1A3FB/Game.app/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file), '/System/Library/Frameworks/AppleCoreNative.framework/AppleCoreNative' (no such file, not in dyld cache) Anyone, please help us to resolve the above issue?
Posted
by
Post not yet marked as solved
0 Replies
685 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
378 Views
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 */
Posted
by
Post not yet marked as solved
1 Replies
550 Views
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)
Posted
by
Post not yet marked as solved
0 Replies
385 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
374 Views
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?
Posted
by
Post not yet marked as solved
0 Replies
377 Views
Hello, We have an API that wraps around Game Center API and we would like to have automated tests for our API. The test would need to run in a remote data center, so there is no way to perform manual test steps. Ideally, we would want to simulate sign in and sign out, test achievements and game saves without the need for any manual input. Running in the simulator should be enough for our use case, though we could also use real devices if necessary. Is there any way to accomplish that?
Posted
by
Post not yet marked as solved
0 Replies
366 Views
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?
Posted
by
Post not yet marked as solved
0 Replies
409 Views
This may be a dumb question, but I can’t seem to find an answer that I understand. If I integrate GameKit/GameCenter into my game, essentially just to auth and then unlock achievements, MAYBE a leaderboard; do I become liable for player data under for ex. GDPR? I don’t plan on sending it anywhere so I guess that’s why I’m so unsure.
Posted
by
Post not yet marked as solved
0 Replies
458 Views
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?
Posted
by
Post not yet marked as solved
0 Replies
483 Views
Hi guys, I want to build a referral program wherein current users are rewarded for inviting friends to join my app/website. I also wanted to keep the accounts linked so that recruiting users can get rewarded every time a new user they recruited purchases something. I want to just give the users points, I'm not offering cash or subscription discounts. similar to how game invites work. through my research into the topic I have found dynamic links with flutter and firebase. deep deferred links, QR code deferred links, and some work around that included taking the user to a website copying the code to their clipboard, then pasting it into a hidden textfield to verify and track the code can anyone help me get started?
Posted
by
Post not yet marked as solved
1 Replies
547 Views
As per the title, as soon as I try to open iCloud settings on the Simulator, a black screen appears and the Preferences app crashes (and a crash report shows up shortly thereafter). This is an issue in all of Xcode 17.0.0, XCode 17.0.1 and the Xcode 17.1 beta. I've tried all the simulator models from the SE to the 15. I think this may be something to do with the following two pop-ups that keep showing up on the Simulator but don't actually do anything when tapped: one says to accept new iCloud T&Cs. When I tap on it, nothing happens (and I can't find new T&Cs to accept in the web browser); and one that prompts me to re-enter the Apple ID password. When I input the password and confirm, nothing happens. This is causing major issues for testing a couple of my apps because Simulator sometimes radomly thinks that the user isn't signed into iCloud when they, in fact, are. For example, I've been getting the following error from GameKit: 'The requested operation could not be completed because you are not signed in to iCloud..' (the same function that throws the error does confim that the user is signed in just before throwing). I'd be very grateful for any thoughts. Been stuck on this for well over a week now...I've found various threads about the wider Preferences app crashing (and this being fixed in the latest beta) but nothing on the specific issue I'm having.
Posted
by
Post not yet marked as solved
1 Replies
418 Views
I am trying to create an iOS plugin for the Godot game engine which utilises GameKit. For some reason it is struggling to build the required static library when #import <GameKit/GameKit.h> is utilised. This does not seem to be a specific Godot issue looking through the error log and seems to be a direct issue with the SDK in XCode 15. Here is an extract from the compilation error for reference (I cannot submit the full error due to forum limitations): scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... g++ -o plugins/gamecenter/game_center_module.o -c -fomit-frame-pointer -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DPTRCALL_ENABLED -DGLES_ENABLED -std=gnu++14 -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DIOS_ENABLED -DUNIX_ENABLED -DCOREAUDIO_ENABLED -fmodules -fcxx-modules -miphoneos-version-min=10.0 -fobjc-arc -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -fno-exceptions -Wno-ambiguous-macro -Wall -Werror=return-type -arch arm64 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/platform/iphone plugins/gamecenter/game_center_module.cpp g++ -o plugins/gamecenter/game_center.o -c -fomit-frame-pointer -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DPTRCALL_ENABLED -DGLES_ENABLED -std=gnu++14 -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DIOS_ENABLED -DUNIX_ENABLED -DCOREAUDIO_ENABLED -fmodules -fcxx-modules -miphoneos-version-min=10.0 -fobjc-arc -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -fno-exceptions -Wno-ambiguous-macro -Wall -Werror=return-type -arch arm64 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/platform/iphone plugins/gamecenter/game_center.mm g++ -o plugins/gamecenter/game_center_delegate.o -c -fomit-frame-pointer -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DPTRCALL_ENABLED -DGLES_ENABLED -std=gnu++14 -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DIOS_ENABLED -DUNIX_ENABLED -DCOREAUDIO_ENABLED -fmodules -fcxx-modules -miphoneos-version-min=10.0 -fobjc-arc -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -fno-exceptions -Wno-ambiguous-macro -Wall -Werror=return-type -arch arm64 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/platform/iphone plugins/gamecenter/game_center_delegate.mm scons: `bin/libgamecenter.arm64-ios.release_debug.a' is up to date. scons: done building targets. scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... g++ -o plugins/gamecenter/game_center_module.o -c -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DPTRCALL_ENABLED -DGLES_ENABLED -std=gnu++14 -fno-aligned-allocation -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DIOS_ENABLED -DUNIX_ENABLED -DCOREAUDIO_ENABLED -fmodules -fcxx-modules -miphoneos-version-min=10.0 -fobjc-arc -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -fno-exceptions -Wno-ambiguous-macro -Wall -Werror=return-type -arch armv7 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/platform/iphone plugins/gamecenter/game_center_module.cpp g++ -o plugins/gamecenter/game_center.o -c -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DPTRCALL_ENABLED -DGLES_ENABLED -std=gnu++14 -fno-aligned-allocation -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DIOS_ENABLED -DUNIX_ENABLED -DCOREAUDIO_ENABLED -fmodules -fcxx-modules -miphoneos-version-min=10.0 -fobjc-arc -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -fno-exceptions -Wno-ambiguous-macro -Wall -Werror=return-type -arch armv7 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/platform/iphone plugins/gamecenter/game_center.mm While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31: While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3: In file included from <module-includes>:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1105:25: error: use of undeclared identifier 'vzip1q_f32'; did you mean 'vzipq_f32'? [2] simd_float4 __r01 = vzip1q_f32(__x0, __x1); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2] __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) { ...... ....... ....... 30 errors generated. scons: *** [plugins/gamecenter/game_center.o] Error 1 scons: building terminated because of errors.
Posted
by
Post not yet marked as solved
5 Replies
636 Views
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);
Posted
by