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

Posts under GameKit tag

200 Posts

Post

Replies

Boosts

Views

Activity

Unity Apple plugin Issue
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?
1
0
1.4k
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
690
Aug ’23
GameCenter causes hiccup when showing access point
Hello, In our Unity game, we've started experiencing application hiccup as a result of calling [[GKAccessPoint shared] setActive:YES]. The call itself does not take much time, but it seems to trigger something that causes a significant app stall causing running animations and transitions to feel laggy. This is new behaviour for us in iOS 16.1, as it did not cause any hiccups on 16.0 or earlier as far as we've noticed. We've tested the same build on 16.0 and 16.1, and it's working smooth on 16.0. The hiccup is present both when logged in and not logged into GameCenter. Did something change in 16.1 that requires us to use this API in a different way, or is it a (known) bug in iOS? My searches have not resulted in any similar reports. Best, -Trond
3
1
1.6k
Jul ’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
1k
Jul ’23
SceneKit Xcode 15 Beta3
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 [?]
1
0
1.1k
Jul ’23
Xcode 15 Beta3 sceneKit templet
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
0
0
982
Jul ’23
Regarding Gamekit samples in apple/unityplugins
I built the Gamekit Sample in apple/unityplugins for iOS and ran "_localPlayer = await GKLocalPlayer.Authenticate();" It worked fine up to the point where the GameCenter popup was displayed. However, the "OnRealtimeMatchmake()" and "OnToggleAccessPoint()" will result in the following error "MissingMethodException: Default constructor not found for type Apple.GameKit.Multiplayer.GKMatchRequest at System.RuntimeType.CreateInstanceMono" and "MissingMethodException: Default constructor not found for type Apple.GameKit.GKAccessPoint at System.RuntimeType.CreateInstanceMono" errors and does not work properly. Please tell me what is the problem here. The environment is as follows iPhone SE (iOS15.5), Unity2020.3.33f1, XCode13.4.1
4
0
3.0k
Jul ’23
iOS Game Center achievements are resetting
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 ...)
1
1
1.7k
Jun ’23
Hang when calling GKLocalPlayer.Local.FetchItems();
public async void FetchItems() { try { var fetchItemsResponse = await GKLocalPlayer.Local.FetchItems(); } catch(GameKitException exception) { Debug.LogError(exception); } } App hangs when calling GKLocalPlayer.Local.FetchItems(); No exception is caught. Apple.Core and Apple.GameKit plugins have been included in our project Reproducible with https://github.com/apple/unityplugins Both Unity 2020 and Unity 2021 iOS and tvOS Xcode Version 13.4.1
7
3
2.3k
Jun ’23
Game Center achievements staying hidden
I’m tracking down a bug report with a game that has a bunch of achievements that do work. I am trying to reveal the name of a hidden achievement once a player learns it is possible, but before they have any progress towards it. GKAchievement* a = [[GKAchievement alloc] initWithIdentifier: anAchievement]; a.percentComplete = 0; [GKAchievement reportAchievements: @[ a ] withCompletionHandler: ^(NSError * _Nullable error) { if (error != nil) { NSLog(@"revealAchievement: %@ failed %@", anAchievement, error); } }]; The documentation says “isHidden is set to NO anytime this method is invoked” but the achievement is not showing up in the UI. The achievement in question is returned by +loadAchievementsWithCompletionHandler:, but it is considered hidden there (lldb) po a <GKAchievement: 0x6000027993e0>id: MonsterKiller.DarkAge 0.000000 (lldb) p a.hidden (BOOL) $3 = YES I am pretty sure this code worked fine (it’s in a game that came out several years ago). Has Game Center changed (I know hidden is technically deprecated now, but I don’t see anything explaining how to reveal an achievement other than by using +reportAchievements:withCompletionHandler:. And yes, the achievement in question is configured on the server (it can be earned, just not revealed with zero progress).
2
0
2.1k
Jun ’23
Could not disable Game Center in my App ID for macOS
Hi everyone, My app was rejected for containing Game Center entitlement, here is what review team respond: Your app contains the Game Center entitlement, but it does not link against the GameKit framework. And they suggest a solution: If you do not intend to use Game Center, please remove the Game Center entitlement. My app does not have Game Center entitlement enabled, but App Identifier do have it enabled by default. The App Identifier was created years ago, and by then the Game Center was enabled mandatory, I can't deselect it since the disable button was grayed out. I thought Apple may has changed this behavior when received rejection, so I tried to disable Game Center again, but after I deselect Game Center for macOS and try to save it on developer portal, it warns me: There is a problem with the request entity Please select at least one configuration for Game Center. Is there anything I missed? Thank you in advance for any possible help. Regards,
18
3
13k
Jun ’23
Using GameKit for Leader to many Follower type connections
I need to exchange small amounts of data in my app near realtime between users who could be anywhere with only an internet connection. One user is a Leader and needs to send data (just a few bytes) to all Followers - up to 30 - about each second. Then each Follower needs to send data (again, just a few bytes) back to the Leader about each second. The requirement is similar to the example app from last year's WWDC networking part 2 video called TicTacToe, except the users may not be local.I've tried using Game Center but can't get it right. I've been able to achieve most of my objectives with this GameKit implementation:Follower starts:[[GKLocalPlayer localPlayer] registerListener:self]; request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; request.playerAttributes = 0x0000000F; request.playerGroup = groupName; [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request...Leader starts:[[GKLocalPlayer localPlayer] registerListener:self]; request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; request.playerAttributes = 0xFFFFFFF0; request.playerGroup = groupName; [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request...You can update UI with the completion handlers, but don't count on a real match until:- (void)match:(GKMatch *)match player:(GKPlayer *)player didChangeConnectionState:(GKPlayerConnectionState)state { use the match / player combo to note the connection for both leader and follower. Add to array of followers for leader. If Leader, call your Leader starts code again }Send data to either with:[match sendData:encoder.encodedData toPlayers:playerArray dataMode:GKMatchSendData(Un)reliableerror:&amp;error];and receive in:- (void)match:(GKMatch *)match didReceiveData:(NSData *)data forRecipient:(GKPlayer *)recipient fromRemotePlayer:(GKPlayer *)player { // you've got mail from player! } So far, so good. Here's the bad news: depending on network strength, connections disconnect regularly. Even though I've built in dependable reconnect code, it can take up to 15 seconds to reconnect so it really isn't a good "real-time" experience.I'm currently testing with various combinations of data size (sometimes pad it so it's heft may keep the connection) or frequency (sometimes just send a "poke me" message) or tweaking the reliable vs unreliable flag in the send message calls.I can get about 10 followers per leader on a good day, but other times, more than 3 followers cycle between connect, disconnect, reconnect in an unusable fashion.I'm still trying to make usable, but wanted to document my success/failures so far in hopes that I can help many and perhaps get help from a few.Any ideas would be welcomed and any tweaks will be tested and reported.
9
0
1.8k
May ’23
Game Center Crash on iOS 16.4 and 16.4.1
Hi, We are facing a strange crash on iOS 16.4 and 16.4.1. The issue is not happening on iPad 16.4. We are getting very limited information on the crash, Here is call stack. 0 GameCenterFoundation 0x00000001f0498054 GKGroupActivityManager.reset() + 228 (GKGroupActivityManager.swift:450) 1 GameCenterFoundation 0x00000001f0496e8d GKGroupActivityManager.leave() + 1 (GKGroupActivityManager.swift:411) 2 GameCenterFoundation 0x00000001f04a67dd @objc closure #1 in GKGroupActivityManager.leave() + 1 3 GameCenterFoundation 0x00000001f04a6835 partial apply for @objc closure #1 in GKGroupActivityManager.leave() + 1 4 GameCenterFoundation 0x00000001f04a67f5 thunk for @escaping @callee_guaranteed @Sendable @async () -> () + 1 5 GameCenterFoundation 0x00000001f04a6839 thunk for @escaping @callee_guaranteed @Sendable @async () -> ()partial apply + 1 6 GameCenterFoundation 0x00000001f04a67f9 specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 7 GameCenterFoundation 0x00000001f04a6899 thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A)specialized partial apply + 1 8 libswift_Concurrency.dylib 0x00000001c84d0dd9 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1 (Task.cpp:496) Tried looking into GKGroupActivityManager but couldn't find any documentation regarding this. High number of our usser base is affected by this issue.
0
1
972
May ’23
In GameKit, how is GkLocalPlayer. isMultiplayerGamingRestricted determined?
I hope this is a simple question, but just wanted to check how GkLocalPlayer.isMultiplayerGamingRestricted is determined. I am curious if this parameter is set to true in one, some, or all of the following scenarios or if I am missing some information. If the user is underage relative to COPPA requirements for who is allowed to participate in multiplayer games If some parental block settings have indicated that this user should not be able to play multiplayer games If the user has somehow been banned from all multiplayer games through GameCenter My question would be relevant for iOS and macOS in case that wasn't obvious. The documentation available online is less specific, so any help would be appreciated!
1
0
841
Apr ’23
Unity Apple plugin Issue
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?
Replies
1
Boosts
0
Views
1.4k
Activity
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 */
Replies
1
Boosts
1
Views
690
Activity
Aug ’23
GameCenter causes hiccup when showing access point
Hello, In our Unity game, we've started experiencing application hiccup as a result of calling [[GKAccessPoint shared] setActive:YES]. The call itself does not take much time, but it seems to trigger something that causes a significant app stall causing running animations and transitions to feel laggy. This is new behaviour for us in iOS 16.1, as it did not cause any hiccups on 16.0 or earlier as far as we've noticed. We've tested the same build on 16.0 and 16.1, and it's working smooth on 16.0. The hiccup is present both when logged in and not logged into GameCenter. Did something change in 16.1 that requires us to use this API in a different way, or is it a (known) bug in iOS? My searches have not resulted in any similar reports. Best, -Trond
Replies
3
Boosts
1
Views
1.6k
Activity
Jul ’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.
Replies
0
Boosts
0
Views
1k
Activity
Jul ’23
SceneKit Xcode 15 Beta3
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 [?]
Replies
1
Boosts
0
Views
1.1k
Activity
Jul ’23
Xcode 15 Beta3 sceneKit templet
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
Replies
0
Boosts
0
Views
982
Activity
Jul ’23
Regarding Gamekit samples in apple/unityplugins
I built the Gamekit Sample in apple/unityplugins for iOS and ran "_localPlayer = await GKLocalPlayer.Authenticate();" It worked fine up to the point where the GameCenter popup was displayed. However, the "OnRealtimeMatchmake()" and "OnToggleAccessPoint()" will result in the following error "MissingMethodException: Default constructor not found for type Apple.GameKit.Multiplayer.GKMatchRequest at System.RuntimeType.CreateInstanceMono" and "MissingMethodException: Default constructor not found for type Apple.GameKit.GKAccessPoint at System.RuntimeType.CreateInstanceMono" errors and does not work properly. Please tell me what is the problem here. The environment is as follows iPhone SE (iOS15.5), Unity2020.3.33f1, XCode13.4.1
Replies
4
Boosts
0
Views
3.0k
Activity
Jul ’23
iOS Game Center achievements are resetting
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 -&gt; it is there; a few seconds later again we send a request -&gt; it is again there; a few more tries and it is gone ...)
Replies
1
Boosts
1
Views
1.7k
Activity
Jun ’23
Game Porting Toolkit Installation
Can't able to install the game porting toolkit it is showing this kind of error i have proper version of brew and path is also correctly defined. Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Replies
1
Boosts
1
Views
1.3k
Activity
Jun ’23
Setting Game Center achievements to non integer values
Is it possible to set an achievement progress to numbers like 0.5% or 50.1%? The fact that achievement progress is reported via a double suggests that it should be possible, but when I try doing it only the integer part seems to be saved.
Replies
4
Boosts
0
Views
1.3k
Activity
Jun ’23
Hang when calling GKLocalPlayer.Local.FetchItems();
public async void FetchItems() { try { var fetchItemsResponse = await GKLocalPlayer.Local.FetchItems(); } catch(GameKitException exception) { Debug.LogError(exception); } } App hangs when calling GKLocalPlayer.Local.FetchItems(); No exception is caught. Apple.Core and Apple.GameKit plugins have been included in our project Reproducible with https://github.com/apple/unityplugins Both Unity 2020 and Unity 2021 iOS and tvOS Xcode Version 13.4.1
Replies
7
Boosts
3
Views
2.3k
Activity
Jun ’23
[Unity Plugin Crash] - When using the AppleCore and GameKit
Hello, I've added the Unity plugin for GameKit and it crashes on lunch, with this message. Library not loaded: @rpath/AppleCoreNative.framework/AppleCoreNative Referenced from: <22A243C2-0F80-36C5-8B0A-9C440F83A640>
Replies
3
Boosts
0
Views
1.8k
Activity
Jun ’23
Game Center achievements staying hidden
I’m tracking down a bug report with a game that has a bunch of achievements that do work. I am trying to reveal the name of a hidden achievement once a player learns it is possible, but before they have any progress towards it. GKAchievement* a = [[GKAchievement alloc] initWithIdentifier: anAchievement]; a.percentComplete = 0; [GKAchievement reportAchievements: @[ a ] withCompletionHandler: ^(NSError * _Nullable error) { if (error != nil) { NSLog(@"revealAchievement: %@ failed %@", anAchievement, error); } }]; The documentation says “isHidden is set to NO anytime this method is invoked” but the achievement is not showing up in the UI. The achievement in question is returned by +loadAchievementsWithCompletionHandler:, but it is considered hidden there (lldb) po a <GKAchievement: 0x6000027993e0>id: MonsterKiller.DarkAge 0.000000 (lldb) p a.hidden (BOOL) $3 = YES I am pretty sure this code worked fine (it’s in a game that came out several years ago). Has Game Center changed (I know hidden is technically deprecated now, but I don’t see anything explaining how to reveal an achievement other than by using +reportAchievements:withCompletionHandler:. And yes, the achievement in question is configured on the server (it can be earned, just not revealed with zero progress).
Replies
2
Boosts
0
Views
2.1k
Activity
Jun ’23
Could not disable Game Center in my App ID for macOS
Hi everyone, My app was rejected for containing Game Center entitlement, here is what review team respond: Your app contains the Game Center entitlement, but it does not link against the GameKit framework. And they suggest a solution: If you do not intend to use Game Center, please remove the Game Center entitlement. My app does not have Game Center entitlement enabled, but App Identifier do have it enabled by default. The App Identifier was created years ago, and by then the Game Center was enabled mandatory, I can't deselect it since the disable button was grayed out. I thought Apple may has changed this behavior when received rejection, so I tried to disable Game Center again, but after I deselect Game Center for macOS and try to save it on developer portal, it warns me: There is a problem with the request entity Please select at least one configuration for Game Center. Is there anything I missed? Thank you in advance for any possible help. Regards,
Replies
18
Boosts
3
Views
13k
Activity
Jun ’23
Using GameKit for Leader to many Follower type connections
I need to exchange small amounts of data in my app near realtime between users who could be anywhere with only an internet connection. One user is a Leader and needs to send data (just a few bytes) to all Followers - up to 30 - about each second. Then each Follower needs to send data (again, just a few bytes) back to the Leader about each second. The requirement is similar to the example app from last year's WWDC networking part 2 video called TicTacToe, except the users may not be local.I've tried using Game Center but can't get it right. I've been able to achieve most of my objectives with this GameKit implementation:Follower starts:[[GKLocalPlayer localPlayer] registerListener:self]; request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; request.playerAttributes = 0x0000000F; request.playerGroup = groupName; [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request...Leader starts:[[GKLocalPlayer localPlayer] registerListener:self]; request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; request.playerAttributes = 0xFFFFFFF0; request.playerGroup = groupName; [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request...You can update UI with the completion handlers, but don't count on a real match until:- (void)match:(GKMatch *)match player:(GKPlayer *)player didChangeConnectionState:(GKPlayerConnectionState)state { use the match / player combo to note the connection for both leader and follower. Add to array of followers for leader. If Leader, call your Leader starts code again }Send data to either with:[match sendData:encoder.encodedData toPlayers:playerArray dataMode:GKMatchSendData(Un)reliableerror:&amp;error];and receive in:- (void)match:(GKMatch *)match didReceiveData:(NSData *)data forRecipient:(GKPlayer *)recipient fromRemotePlayer:(GKPlayer *)player { // you've got mail from player! } So far, so good. Here's the bad news: depending on network strength, connections disconnect regularly. Even though I've built in dependable reconnect code, it can take up to 15 seconds to reconnect so it really isn't a good "real-time" experience.I'm currently testing with various combinations of data size (sometimes pad it so it's heft may keep the connection) or frequency (sometimes just send a "poke me" message) or tweaking the reliable vs unreliable flag in the send message calls.I can get about 10 followers per leader on a good day, but other times, more than 3 followers cycle between connect, disconnect, reconnect in an unusable fashion.I'm still trying to make usable, but wanted to document my success/failures so far in hopes that I can help many and perhaps get help from a few.Any ideas would be welcomed and any tweaks will be tested and reported.
Replies
9
Boosts
0
Views
1.8k
Activity
May ’23
Game Center Crash on iOS 16.4 and 16.4.1
Hi, We are facing a strange crash on iOS 16.4 and 16.4.1. The issue is not happening on iPad 16.4. We are getting very limited information on the crash, Here is call stack. 0 GameCenterFoundation 0x00000001f0498054 GKGroupActivityManager.reset() + 228 (GKGroupActivityManager.swift:450) 1 GameCenterFoundation 0x00000001f0496e8d GKGroupActivityManager.leave() + 1 (GKGroupActivityManager.swift:411) 2 GameCenterFoundation 0x00000001f04a67dd @objc closure #1 in GKGroupActivityManager.leave() + 1 3 GameCenterFoundation 0x00000001f04a6835 partial apply for @objc closure #1 in GKGroupActivityManager.leave() + 1 4 GameCenterFoundation 0x00000001f04a67f5 thunk for @escaping @callee_guaranteed @Sendable @async () -> () + 1 5 GameCenterFoundation 0x00000001f04a6839 thunk for @escaping @callee_guaranteed @Sendable @async () -> ()partial apply + 1 6 GameCenterFoundation 0x00000001f04a67f9 specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 7 GameCenterFoundation 0x00000001f04a6899 thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A)specialized partial apply + 1 8 libswift_Concurrency.dylib 0x00000001c84d0dd9 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1 (Task.cpp:496) Tried looking into GKGroupActivityManager but couldn't find any documentation regarding this. High number of our usser base is affected by this issue.
Replies
0
Boosts
1
Views
972
Activity
May ’23
android app
how to use android app in m1 chips?!!!!!
Replies
1
Boosts
0
Views
1.1k
Activity
May ’23
It says that there is no account with my game center
ive been on 2 apps where i have game center on them but it says there is no accountwithy game center being connected
Replies
0
Boosts
0
Views
1.1k
Activity
May ’23
In GameKit, how is GkLocalPlayer. isMultiplayerGamingRestricted determined?
I hope this is a simple question, but just wanted to check how GkLocalPlayer.isMultiplayerGamingRestricted is determined. I am curious if this parameter is set to true in one, some, or all of the following scenarios or if I am missing some information. If the user is underage relative to COPPA requirements for who is allowed to participate in multiplayer games If some parental block settings have indicated that this user should not be able to play multiplayer games If the user has somehow been banned from all multiplayer games through GameCenter My question would be relevant for iOS and macOS in case that wasn't obvious. The documentation available online is less specific, so any help would be appreciated!
Replies
1
Boosts
0
Views
841
Activity
Apr ’23
Achievements on appstore listing
I saw apple arcade is showing achievements on app listing, please non apple arcade devs need this feature too. At least one of achievement per app should be allow to us too for showing it on listing page.
Replies
0
Boosts
0
Views
699
Activity
Mar ’23