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

GameKit Documentation

Posts under GameKit tag

73 Posts
Sort by:
Post not yet marked as solved
1 Replies
890 Views
Hi everyone! I'm experiencing an issue about Game Center's authentication behaviour. Login prompt is now displayed immediately if user is not logged in to Game Center on System Settings / Game Center. Expected behaviour (Before 14.5 beta 5): Set callback to authenticateHandler at app launch. Callback fired: If viewController is null, this means user logged in to Game Center and we successfully authenticated user. User sees a Game Center banner says "Signed in as nickname" If viewController is not null, this means user not logged in to Game Center in settings. If you want to show user a login prompt, use viewController. If you don't want to show user a login prompt, end authentication flow and user won't see a login prompt. Current behaviour (After 14.5 beta 5): Set callback to authenticateHandler at app launch. iOS immediately shows login prompt if user not logged in to Game Center, before callback fired. Does anyone encounter same issue? I don't want to show login prompt to users if they are not logged into Game Center. My solution was working fine until 14.5 beta 5. Any help will be appreciated.
Posted
by
Post not yet marked as solved
2 Replies
454 Views
I am working on an open source library to help with easier integration of GameCenter Authentication and Matchmaking. [REF] https://github.com/SwiftPackageRepository/GameKitUI.swift After successfully getting iOS flawlessly working, I was up to the task to support macOS. So far authentication is working and match making allows me to select players as expected, nearby players are shown so local service discovery seems to work without troubles. But when the inviting from one to another macOS client I always get issues with binding the sockets: 2021-04-03 15:49:31.861398+0200 GKMatchMaker[12213:341178] [authentication] Player authenticated OI234X 2021-04-03 15:49:37.971324+0200 GKMatchMaker[12213:341178] [ViceroyTrace] CDXClient [ERROR] -[CDXClient setError:]:814 (0x7fbb6de35510) err = Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={NSLocalizedFailureReason=Unable to bind FD to sockaddr. Operation not permitted} 2021-04-03 15:49:37.971427+0200 GKMatchMaker[12213:341178] [ViceroyTrace]  [ERROR] -[GKConnectionInternal CDXClient:error:]:1281 [GKConnection CDXClient:error:]: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={NSLocalizedFailureReason=Unable to bind FD to sockaddr. Operation not permitted} Any help is gladly appreciated. Thanks.
Posted
by
Post not yet marked as solved
2 Replies
590 Views
Good afternoon from Germany. I like to update an app to support Game Center but I think I am doing something fundamentally wrong. I created two simple Game Center achievements in App Store Connect for this app and they are marked as not hidden. I can authenticate and log in to Game Center with the app. I can also show the dashboard in Game Center. But then there is nothing to see. Achievements 0 / 0. Should't I see my 2 achievements that I created in App Store Connect? Thank you to bring some light into this darkness :-) Best, Peter
Posted
by
Post not yet marked as solved
3 Replies
791 Views
Greetings, We authenticate the player with GameCenter, then after we check for GKLocalPlayer.isAuthenticated == true. Finally we fetch the teamPlayerId but we are seeing "Unavailable Player Identification" returned. What is the cause of this value being returned? We are required to fetch this property in order to validate the GameCenter authorization via GKLocalPlayer.fetchItems. Thanks in advance!
Posted
by
Post not yet marked as solved
0 Replies
2k Views
Starting August 4, 2021, a new certificate for server-based Game Center verification will be available via the publicKeyUrl property of fetchItems(forIdentityVerificationSignature:) or generateIdentityVerificationSignature. The previous certificate will no longer be available after this date. As a reminder, make sure your app always retrieves and uses the current publicKeyUrl value so it automatically uses the new certificate.  If your app caches the certificate or hardcodes the certificate URL, you’ll need to update to https://static.gc.apple.com/public-key/gc-prod-6.cer. Please note, this root certificate issuer has been updated from Symantec Corporation to DigiCert, Inc. Make sure to check that the new root certificate issuer is on your list of trusted CAs. You can download the trusted root CA (DigiCert trusted G4) from https://knowledge.digicert.com/alerts/code-signing-new-minimum-rsa-keysize.html Following industry standards introduced this year, this new certificate’s key has also been increased to 4096 bits to meet the 3072 bit or larger requirement. This change in key length shouldn't impact current functionality.
Posted
by
Technology Evangelist
Post not yet marked as solved
0 Replies
381 Views
So I have access to the conflicting save games. I go through the save games and then pick the one with the most current time and load it. Now my question is when calling resolveConflictingSavedGames. It requires a conflictingSavedGames array that includes all the conflicting save games. Do I include ALL the conflicting save games I found including the one I just loaded with the most recent time? Also in the resolveConflictingSavedGames completion handler what exactly do I do? Do I just check for errors and nothing else? Thank you for any help I can get!
Posted
by
Post not yet marked as solved
0 Replies
324 Views
I am working on an a Game that authenticates user either through Game Center or Anonymously through Firebase. I want to reward player through codes that he can redeem online. I wanted to know if it is possible to get an Email ID once a player has logged in though Game Center. I can ask user to provide one while I do the same thing on Play Games. Please advice.
Posted
by
Post not yet marked as solved
0 Replies
393 Views
So I am trying implement GameKit SaveGame functionality on my iOS game. I am aware that this requires iCloud and iCloud Drive access in order to work properly. When I call fetch from the GameKit API I get an error message saying: "The requested operation could not be completed because you are not signed in to iCloud or iCloud Drive is not activated" I have both activated, so my iCloud account is ready and my iCloud Drive is activated. However I don't see my app in the list of apps using iCloud Drive. Do I need to add any permission to the info.plist for it to work? I added iCloud -> documents features in xCode already and it doesn't do the trick, so I must be missing something. Do I need to activate something for my app under the iCloud Dashboard? I really need to deliver this product I'm working on and it's being really complicated to find the solution.
Posted
by
Post not yet marked as solved
4 Replies
1.1k Views
Prior to iOS 14.5, I adopted the following workflow for my Game Center enabled game - At the launch, if there is no authenticated GKLocalPlayer, then store the viewController passed in the completion handler and display it later to the user (i.e. not immediately after the app completes launching). I am using the following code for the authentication process -         GKLocalPlayer.local.authenticateHandler = {viewController, error in             if (viewController != nil){ //store the viewController and present it at a later time             } else if (GKLocalPlayer.local.isAuthenticated) { //successfully authenticated             } else { // player could not be authenticated             } Since iOS 14.5 the callback to the authenticationHandler seems to have changed. The login prompt is displayed automatically after app launch, if there is no authenticated player. I checked - the completionHandler is not even being called in this case before the login prompt is presented. If there is already an authenticated player on the device, then the handler is called as expected. How can I prevent the login prompt from being displayed automatically by the system? Is there a new workflow for authenticating a player from iOS 14.5 onwards? thanks,
Posted
by
Post not yet marked as solved
1 Replies
295 Views
Hi Guys, i recently have lost my PUBGM account that i link to Game Center, have check Game Center ID and Apple ID but still can’t retrieve my account. Previously is ok when i have switch from IP6 to IP12. After the new IOS update i lost my account is there any other way to get it back?
Posted
by
Post not yet marked as solved
0 Replies
224 Views
I have received game centre friend requests and when I try to accept I receive a notification that a verification code is being sent to my email. Email address is correct and I have access to it but no code arrives. Does anyone have any suggestions please?
Posted
by
Post not yet marked as solved
1 Replies
415 Views
Hello every one, I loaded all my friends from Game Center, but every time that I close and start up the game all friends ids change, is this normal? or how can I set the same gamePlayerID and teamPlayerID for all instances? I really appreciate a lot your help IOS version 14.5
Posted
by
Post not yet marked as solved
0 Replies
241 Views
Hello every one, Is there an full example of how to implement loadFriends in objective-c? https://developer.apple.com/documentation/gamekit/gklocalplayer/3726201-loadfriends?language=objc Thanks!
Posted
by
Post not yet marked as solved
0 Replies
282 Views
When I try to retrieveScores from the gamecenter I get the error: "Couldn’t communicate with a helper application." The leaderboard I am trying to get scores from is a recurring leaderboard. Previously I have called LoadLeaderboardIds. I am using Prime31 unity plugin to communicate with GameCenter. Before updating prime31 I had no errors, however I needed to update the plugin to be able to get recurring leaderboards. I asked on the Prime31 forum, but was told that: "That sounds like an internal Apple error. App code cant launch or communicate with helper apps, only Apple's code can do cross-process communication. You'll want to open a bug report directly with Apple." The error happens on the iOS build but I have not tested other platforms yet.
Posted
by
Post not yet marked as solved
1 Replies
393 Views
i'm trying to use exchanges and localization. i'm getting different results on iOS versus on macOS. i have the following line in my Localizable.strings (English) file "emote_message_hello" = "hello"; here's my sendExchange function: gkTurnBasedMatch.sendExchange(to:[opponent],                    data:Data(),                    localizableMessageKey:"emote_message_hello",                    arguments:[],                    timeout:TimeInterval(1)) and here is my receivedExchangeRequest function   func player(_ player:GKPlayer, receivedExchangeRequest exchange:GKTurnBasedExchange, for gkTurnBasedMatch: GKTurnBasedMatch) {     print("\(exchange.message)") } on macOS this outputs "hello". yet the same code on iOS outputs "emote_message_hello". in other words it appears that macOS is automatically localizing the string, while iOS is not. am i doing something wrong or is this a bug?
Posted
by
Post not yet marked as solved
2 Replies
271 Views
Hey! My friend and I recently developed an app with leaderboards. We had the scoring system set to higher for testing purposes, leading to me having a score that is relatively unobtainable with the scoring system we launched with. However, when we launched (https://www.example.com/ https://evergreenapk.com/) the leaderboards weren't scrubbed, so my score is way beyond everyone else. My score is the only one affected, so would it be possible to remove my all-time scores and utilize the ones I've earned since our launch? Please let me know!
Posted
by
Post not yet marked as solved
0 Replies
335 Views
Hi, I'm trying to implement the following Fast Start code shown during WWDC 2021 . However, I'm getting an error on the GameSceneViewController line. I've tried this with both a Game and an App template in Xcode 13, but both get hung up here. Can anyone help me make this work? Thank you so much
Posted
by
Post marked as solved
2 Replies
355 Views
I’m the developer of a health and fitness macOS app called Simon Says previously known as Sluggard. It’s been around for a few years already, and currently I’m working on a new major version update. I am currently considering adding achievements and leaderboards, but I am not sure if a “regular” app is eligible for GameKit and its features. It seems like CloudKit would be more suitable for that. Am I right? GameKit has almost everything I need. The only problem is that my app is not a game at all.
Posted
by
Post not yet marked as solved
0 Replies
225 Views
Hello, I am trying to load a player avatar for a given ID. On the GKPlayer documentation page, it is recommended to use the loadPlayers(forIdentifiers:withCompletionHandler:) method to retrieve GKPlayer objects which can then be used in the loadPhoto(for:withCompletionHandler:) method. However, the documentation for loadPlayers states, that this function is deprecated since iOS 14.5. XCode suggests to use the GKLocalPlayer.loadFriends method (documentation). Anyway, this is not a replacement for loadPlayers since loadFriends, as the name suggests, only loads players from the friends list instead of a global list. It is weird that the GKPlayer docs suggest the use of loadPlayers which is deprecated. Is there a workaround to this? Best regards