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

GameKit Documentation

Posts under GameKit tag

86 Posts
Sort by:
Post not yet marked as solved
0 Replies
50 Views
When I run the following code, the Matchmaker view is populated with me (local player) and my opponent (correct picture and friendly name). however, the "Send Game" button is disabled. I assume that recipients is set correctly. There are errors from loadPlayersForIdentifiers . GKMatchRequest *request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; request.defaultNumberOfPlayers = 2; request.inviteMessage = @"Testing"; [GKPlayer loadPlayersForIdentifiers:@[ playerID ] withCompletionHandler:^(NSArray<GKPlayer *> *_Nullable players, NSError *_Nullable error) { if (error) { NSLog(@"Error loading player: %@", error); } else if (players.count > 0) { request.recipients = players; GKTurnBasedMatchmakerViewController *mmvc = [[GKTurnBasedMatchmakerViewController alloc] initWithMatchRequest:request]; mmvc.turnBasedMatchmakerDelegate = self; mmvc.showExistingMatches = NO; [self presentViewController:mmvc animated:YES completion:nil]; } }]; If I remove the opponent, and then re-add them manually, the "Send Game" button is enabled.
Posted
by
Post not yet marked as solved
1 Replies
114 Views
Hello everyone, So I will start off by saying I am a very amateur developer with some experience in C++ mostly. Over the summer I want to build an app similar to a board game and launch it on the App Store for me and my friends to play when we don't have the game's physical board. Basically, there would be one person who hosts a "game" while everyone else joins through a code or something like that (maybe there's an easier way if you know everyone would be playing in person with each other). Once a game begins I want cards to show up on peoples's screens and that's it, no fancy graphics or anything like that. So, to the root of my issue. I am brand new to Swift and Xcode. I began googling and tinkering with it and made a little app where a user can add names and then pick letters from the names to display (very very basic stuff). I also figured out how to import and manipulate images a little bit. My question is about the process of making a game, connecting it to GameKit/Game Center, and then how to actually launch it on the App Store so my friends can also download it. If anyone has any resources they particularly found useful when starting out using Swift, please let me know. I really really don't like reading straight from the documentation (although who does honestly). Anything helps!! Thank you!
Posted
by
Post not yet marked as solved
0 Replies
65 Views
Here is a link to a super long conversation with a true genius at StackOverflow https://stackoverflow.com/questions/78343630/what-algorithm-is-available-to-correlate-a-skspritenodes-position-with-the-uibe/78379892#78379892 He has done an extraordinary amount of work to make up for what I consider is the non-working of UIBezierPath’s orientToPath = true. He’s done multiple hours work to make up for orientToPath = true not working. What are we missing?
Posted
by
Post not yet marked as solved
0 Replies
129 Views
[UE] Assertion failed: Binding.index < ML_MaxTextures [File:./Runtime/Apple/MetalRHI/Private/MetalPipeline.cpp] [Line: 563] Metal texture index exceeded! How can I solve it?
Posted
by
Post not yet marked as solved
3 Replies
480 Views
My MacBook Pro is M3 max, running macOS 14.4.1 (23E224), with Xcode 15.3 and Command_Line_Tools_for_Xcode_15.3 installed. When I tried to execute "brew -v install apple/apple/game-porting-toolkit", it reported the following error. Error: apple/apple/game-porting-toolkit 1.1 did not build Logs: /Users/yuanmouren/Library/Logs/Homebrew/game-porting-toolkit/00.options.out /Users/yuanmouren/Library/Logs/Homebrew/game-porting-toolkit/01.configure /Users/yuanmouren/Library/Logs/Homebrew/game-porting-toolkit/01.configure.cc /Users/yuanmouren/Library/Logs/Homebrew/game-porting-toolkit/02.make /Users/yuanmouren/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 found the following error reasons in the console. /private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:629:11: error: unknown type name 'SecTrustSettingsDomain' const SecTrustSettingsDomain domains[] = { ^ /private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:630:9: error: use of undeclared identifier 'kSecTrustSettingsDomainSystem' kSecTrustSettingsDomainSystem, ^ /private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:631:9: error: use of undeclared identifier 'kSecTrustSettingsDomainAdmin' kSecTrustSettingsDomainAdmin, ^ /private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:632:9: error: use of undeclared identifier 'kSecTrustSettingsDomainUser' kSecTrustSettingsDomainUser ^ /private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:640:18: warning: this function declaration is not a prototype [-Wstrict-prototypes] status = SecTrustSettingsCopyCertificates(domains[domain], &certs); ^ /private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:641:23: error: use of undeclared identifier 'noErr' if (status == noErr) ^ /private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:647:31: warning: this function declaration is not a prototype [-Wstrict-prototypes] if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr) ^ /private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:647:51: error: use of undeclared identifier 'kSecFormatX509Cert' if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr) ^ /private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:647:95: error: use of undeclared identifier 'noErr' if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr) ^ 2 warnings and 7 errors generated. make: *** [dlls/crypt32/unixlib.o] Error 1 make: *** Waiting for unfinished jobs.... How should I resolve this issue?
Posted
by
Post not yet marked as solved
0 Replies
178 Views
Hello, As stated in the title, we implemented the GameKit unity package. We did a lot of testing and never encountered any issue related to the authentication until now, andwe identified that the device with the issue was Intel. The configurations and provisioning profile used are correctly set. I was wondering if any of you encountered this issue or had an idea how to debug this? Thanks!
Posted
by
Post not yet marked as solved
0 Replies
136 Views
I have a two-level view-based NSOutlineView, employing a data-source and delegate. It is not populated by binding. My code is all ObjC, and my problem persist since MacOS 10.11 to the current MacOS 14.4.x Because of some specific visual issue, I use a very simple subclass of NSTableRowView, which has only this: @implementation MYRowView - (void)drawRect:(NSRect)dirtyRect { self.emphasized = NO; // this affects the complicated color scheme for selection - will not use the "alternateColor" for drawing, but rather the "secondary color" - who knows what it is. This way our texts and icons and progress do NOT disappear on selected rows. [super drawRect:dirtyRect]; } @end And then later, in my NSOutlineView delegate: -(NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item { return [OITRowView new]; } There are, other more complicated @interface OITOutlineCellView : NSTableCellView That I makeViewWithIdentifier:owner: and populate in response to NSOutlineView - (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item { Now I noticed that after adding several items (top level) with some thousands sub-level items to my outline-view, and then REMOVING them and reloading all data - my app's memory is ever increasing When I used the memory graph feature in Xcode debugger - I found a huge number (actually identical to the maximum number of rows) - all of the class MYRowView. Interestingly enough - none of my cell-views remained in memory. Now I verified - my data source reported zero items, the UI looks empty, and all functions as expected - except for this "leak" of MYRowView objects. As you can see in the code (copied exactly from my app) I only create them - and return them to the OS - I never hold any reference to these objects. So.... What Am I doing wrong, and what can I do to alleviate the issue?? The methods [NSOutlineView reloadItem:reloadChildren:] and [NSTableView reloadData] are documented to "release all related views" -- but obviously they DONT. my app gets to ~300 MB (started at 20MB) with about 7500 rows Idea anyone? What to check? what to try?
Posted
by
Post not yet marked as solved
2 Replies
424 Views
Hi! I have a new game and I have setup the leaderboards and achievements in App Store Connect but all of them are "not live" and in console I see this warning: "No AchievementDescription could be found for Achievement with ID: {my_ID}" I did not do a fresh Game Center setup for a long time, but is there any way to test if achievements and leaderboards are working for nonreleased game? Thank you!
Posted
by
Post not yet marked as solved
1 Replies
177 Views
I started adding GameCenter support for my visionOS game and I noticed an issue. After authenticating the player the access point shows in the location I specified but my window content gets an overlay and game cannot be used. Anybody has experience with GameCenter on visionOS and how to properly set it up and use the GKAccessPoint? Thank you! Adding a screenshot:
Posted
by
Post not yet marked as solved
0 Replies
227 Views
Recently (I'm not sure exactly when), the "Sign in to Game Center" banner started appearing at the top of my app when the app sets the GC authentication handler and there is no Game Center player currently signed in on the device: So far so good. But if the banner is tapped, a full "Sign In to Game Center" modal view automatically appears and covers the app without notification: This is not the sign-in view controller that the GC authentication handler normally passes when a player is not signed in, which previously gave my app control over when to present it. My app is unaware that it is covered by this new sign-in screen. Is there any way for my app to know when the user taps the "Sign In" banner and causes this new automatic sign-in screen to appear? I need to pause my game while it is covered up. In general, is there a way for my view controller to be notified when it has been covered by a modal view controller that's outside my app's control?
Posted
by
Post not yet marked as solved
0 Replies
247 Views
I've installed the GPTK before, but it pops up with some problems so I want to reinstall it again. So I deleted home brew and redownload all the materials I needed. But when it comes to install the game-porting-toolkit formula, I can't download it, did anyone have the same problem with me? jimmy@Jimmymbp14 ~ % brew -v install apple/apple/game-porting-toolkit Error: Formulae found in multiple taps: * apple/apple/game-porting-toolkit-compiler * gcenx/apple/game-porting-toolkit-compiler Please use the fully-qualified name (e.g. apple/apple/game-porting-toolkit-compiler) to refer to a specific formula. jimmy@Jimmymbp14 ~ %
Posted
by
Post not yet marked as solved
2 Replies
336 Views
I am currently developing an USB HID Device, specifically a type of Joystick. However it seems that any attempt of getting a joystick to work on Mac do not work. My prototype works perfectly on Windows, being recognised as such and receiving all data. On MacOS, the Joystick is not recognised as a Joystick though, and the OS does not seem to receiver any Input from it whatsoever. I have translated my code to use both Mouse and Keyboard, both work perfectly. I have also tried to have the Joystick identify as a Gamepad, but again, it works on Windows and is not recognised on Mac (is not recognised as a Gamepad). Are there any specific restrictions to HID devices on MacOS? Apple developer only seems to describe specifics from a software standpoint, not from the standpoint of someone developing hardware. And even then it only seems to describe very specific HID devices, such as mouse, keyboard or a stylus. Please also keep in mind that I don't have much experience developing MacOS applications.
Posted
by
Post marked as solved
1 Replies
914 Views
I need clarification on the GKLocalPlayer.local.isMultiplayerGamingRestricted behavior which check's user's device capability (whether it is set up to allow or disallow multiplayer) I am referring to this from Apple documentation at : https://developer.apple.com/documentation/gamekit/authenticating_a_player if GKLocalPlayer.local.isMultiplayerGamingRestricted { // Disable multiplayer game features. } The issue is that this is a boolean (true/false value ) However I have noticed that iOS ( latest version and preceding versions) allow people to have the following options: ( you can set these under screen time -> content restrictions -> Multiplayer games ) Disallow all multiplayer games - presumably your API returns a false for this. Allow multiplayer with friends only -???? what does GKLocalPlayer.local.isMultiplayerGamingRestricted return here?? if True, how is the Friends only restriction handled? Are we supposed to do something to force it? Note: So far I am relying on Apple's Game Center native experience and have not added wrappers to do additional filtering etc. I hope that I shall be able to keep doing so. Allow all multiplayer games - presumably your API returns a false for this. You can see how there are three choices but this is modeled as a boolean. Choice number 2. is not addressed. Has anyone come across this? Note: This is very different from checking for underage users. No matter what I do, in my post above, it won't set the correct numbers for numbered bullet -points. I call them 1, 2, 3 it posts 1,1,2 or 1.,2,1 etc. ( side nit ) Apologies if this isn't as readable as it should be.
Posted
by
Post marked as solved
1 Replies
322 Views
I have a custom Objective-C ObjectCache class that utilized NSMutableDictionary to store named objects (specifically large NSImage objects). The class has a maxItems property and clear method, which worked fine. - (void)clear { @synchronized(_cache) { [_cache removeAllObjects]; } } But yesterday I received a customer feedback complaining one of my app consumes up to 24GB memory. I verified that on my M1 Mac mini, and it's true. Even after calling clear method, memory usage shown in both Xcode debugger panel and Activity Monitor remains the same. It did work before. Once I close a picture gallery window by calling clear method, memory usage dropped immediately as shown in Activity Monitor. I suspect that this is a bug in ARM architecture. Does anyone else have same problem?
Posted
by
Post not yet marked as solved
0 Replies
584 Views
We are noticing below iOS crash majorly happening from iOS 17 version. Can someone please check and let me know what might be causing this crash and how to solve this? Attached full crash report from app store. Last Exception Backtrace: 0 CoreFoundation 0x1b5cce69c __exceptionPreprocess + 164 (NSException.m:249) 1 libobjc.A.dylib 0x1adf67c80 objc_exception_throw + 60 (objc-exception.mm:356) 2 UIKitCore 0x1b8592ab4 -[UIViewController _presentViewController:withAnimationController:completion:] + 4236 (UIViewController.m:0) 3 UIKitCore 0x1b859312c __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 92 (UIViewController.m:9730) 4 UIKitCore 0x1b7f36fac -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 128 (UIViewControllerTransitioning.m:1205) 5 UIKitCore 0x1b7f36ab4 -[_UIViewControllerTransitionContext _runAlongsideCompletions] + 140 (UIViewControllerTransitioning.m:393) 6 UIKitCore 0x1b7f36144 -[_UIViewControllerTransitionContext completeTransition:] + 128 (UIViewControllerTransitioning.m:307) 7 UIKitCore 0x1b80a9460 -[UITransitionView notifyDidCompleteTransition:] + 180 (UITransitionView.m:280) 8 UIKitCore 0x1b80a9118 -[UITransitionView _didCompleteTransition:] + 832 (UITransitionView.m:249) 9 UIKitCore 0x1b7e91d78 UIVIEW_IS_EXECUTING_ANIMATION_COMPLETION_BLOCK + 36 (UIView.m:16376) 10 UIKitCore 0x1b7e91510 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 624 (UIView.m:16409) 11 UIKitCore 0x1b7e90b88 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 436 (UIView.m:0) 12 UIKitCore 0x1b7e72d84 -[UIViewAnimationState animationDidStop:finished:] + 196 (UIView.m:2407) 13 UIKitCore 0x1b7e72e98 -[UIViewAnimationState animationDidStop:finished:] + 472 (UIView.m:2426) 14 QuartzCore 0x1b725f980 run_animation_callbacks(void*) + 132 (CALayer.mm:7713) 15 libdispatch.dylib 0x1bdbd9300 _dispatch_client_callout + 20 (object.m:561) 16 libdispatch.dylib 0x1bdbe7998 _dispatch_main_queue_drain + 984 (queue.c:7813) 17 libdispatch.dylib 0x1bdbe75b0 _dispatch_main_queue_callback_4CF + 44 (queue.c:7973) 18 CoreFoundation 0x1b5c1901c CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 (CFRunLoop.c:1780) 19 CoreFoundation 0x1b5c15d28 __CFRunLoopRun + 1996 (CFRunLoop.c:3149) 20 CoreFoundation 0x1b5c15478 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420) 21 GraphicsServices 0x1f91964f8 GSEventRunModal + 164 (GSEvent.c:2196) 22 UIKitCore 0x1b803962c -[UIApplication _run] + 888 (UIApplication.m:3685) 23 UIKitCore 0x1b8038c68 UIApplicationMain + 340 (UIApplication.m:5270) 24 UnityFramework 0x11151c310 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 92 (main.mm:124) 25 myapp 0x10497c17c main + 60 (main.mm:26) 26 dyld 0x1d894edcc start + 2240 (dyldMain.cpp:1269) Kernel Triage: VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter VM - (arg = 0x3) mach_vm_allocate_kernel failed within call to vm_map_enter Thread 0 name: Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000001fd349fbc __pthread_kill + 8 (:-1) 1 libsystem_pthread.dylib 0x000000021fc0b680 pthread_kill + 268 (pthread.c:1681) 2 libsystem_c.dylib 0x00000001bdc91c24 __abort + 136 (abort.c:159) 3 libsystem_c.dylib 0x00000001bdc91b9c abort + 192 (abort.c:126) 4 libc++abi.dylib 0x000000021fb35ff8 abort_message + 132 (abort_message.cpp:78) 5 libc++abi.dylib 0x000000021fb25f90 demangling_terminate_handler() + 348 (cxa_default_handlers.cpp:77) 6 libobjc.A.dylib 0x00000001adf6ada4 _objc_terminate() + 144 (objc-exception.mm:496) 7 UnityFramework 0x000000011358d254 CPPExceptionTerminate() + 332 (BSG_KSCrashSentry_CPPException.mm:137) 8 libc++abi.dylib 0x000000021fb353bc std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:59) 9 libc++abi.dylib 0x000000021fb35360 std::terminate() + 108 (cxa_handlers.cpp:88) 10 libdispatch.dylib 0x00000001bdbd9314 _dispatch_client_callout + 40 (object.m:564) 11 libdispatch.dylib 0x00000001bdbe7998 _dispatch_main_queue_drain + 984 (queue.c:7813) 12 libdispatch.dylib 0x00000001bdbe75b0 _dispatch_main_queue_callback_4CF + 44 (queue.c:7973) 13 CoreFoundation 0x00000001b5c1901c CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 (CFRunLoop.c:1780) 14 CoreFoundation 0x00000001b5c15d28 __CFRunLoopRun + 1996 (CFRunLoop.c:3149) 15 CoreFoundation 0x00000001b5c15478 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420) 16 GraphicsServices 0x00000001f91964f8 GSEventRunModal + 164 (GSEvent.c:2196) 17 UIKitCore 0x00000001b803962c -[UIApplication _run] + 888 (UIApplication.m:3685) 18 UIKitCore 0x00000001b8038c68 UIApplicationMain + 340 (UIApplication.m:5270) 19 UnityFramework 0x000000011151c310 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 92 (main.mm:124) 20 myapp 0x000000010497c17c main + 60 (main.mm:26) 21 dyld 0x00000001d894edcc start + 2240 (dyldMain.cpp:1269) NSInvalidArgumentException.txt
Posted
by
Post not yet marked as solved
1 Replies
403 Views
We noticing below crash mainly happening in iOS 17. Can someone check and confirm what is the root cause for this and how to fix the crash. GKAppLevelSignInVisibility fetchAppLevelVisibilityConstraintsWithHandler Thread 36 Crashed: 0 CoreFoundation 0x00000001904a9d6c -[__NSDictionaryM setObject:forKeyedSubscript:] + 452 (NSDictionaryM.m:202) 1 GameCenterUICore 0x000000020fe6d508 __76+[GKAppLevelSignInVisibility fetchAppLevelVisibilityConstraintsWithHandler:]_block_invoke_3 + 84 (GKAppLevelSignInVisibility.m:82) 2 GameCenterFoundation 0x00000001c8b8971c @objc closure #1 in LimitedPresentationManager.presentationDisabled(config:context:) + 268 3 GameCenterFoundation 0x00000001c8b8b111 partial apply for @objc closure #1 in LimitedPresentationManager.presentationDisabled(config:context:) + 1 4 GameCenterFoundation 0x00000001c8b8b101 thunk for @escaping @callee_guaranteed @Sendable @async () -> () + 1 5 GameCenterFoundation 0x00000001c8b8b105 partial apply for thunk for @escaping @callee_guaranteed @Sendable @async () -> () + 1 6 GameCenterFoundation 0x00000001c8b8aa0d specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 (:0) 7 GameCenterFoundation 0x00000001c8b8ab6d partial apply for specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 (:0) 8 libswift_Concurrency.dylib 0x000000019b78da41 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1 (Task.cpp:463) Full iOS crash log
Posted
by
Post marked as solved
2 Replies
336 Views
Hello, I am building an app that requires players joined to an online game session and to have a video chat with both of their front cameras turned on. I currently know that GameKit supports the voice chat option but could not find any source for video chat. Is it possible set up a video chat on an online game session?. What libraries can I use that have support in implementing the video chat (AVFoundation) ? Your assistance is greatly appreciated.
Posted
by