gamekit

IOS GAME KIT - Where do I find pending invitations? GKInvite or AKA how do I accept programmatically an invitation?

醉酒当歌 提交于 2021-01-29 09:39:18
问题 As many others I am trying to figure out how gamekit works. At the moment I am able to invite a friend and accept it. But what I am not able to do is to 'catch' incoming invites, if the player missed the notification how can I present missed invitations to the player? Assuming the other side will wait of course to get connected. I simply want to offer the user a way to accept a pending invitation after the notification is gone. Scenario : User 1 > sends invite to User 2 User 2 > was too late

How do I force iCloud to sync data of an App on fresh install / first launch?

隐身守侯 提交于 2020-12-15 06:03:51
问题 In a game I am working on I have implemented GKSavedGames and everything is working correctly except that if the game is uninstalled and reinstalled or installed on a new device the first initial launch fetchSavedGamesWithCompletionHandler returns 0 saved games. Is there a way to force iCloud to sync the files to the device? I have tried waiting and recalling fetchSavedGamesWithCompletionHandler but nothing seems to work. If I immediately relaunch the app all the save files are then available

How is GKTurnBasedMatchmaker used?

风流意气都作罢 提交于 2020-02-08 07:54:09
问题 I'm trying to create a simple turn based 2 player game, but am struggling to understand how to use GKTurnBasedMatchmaker Here's the steps I have so far: Authenticate Local Player Make my view controller the GKTurnbasedMatchmakerViewControllerDelegate Present the matchmaking view controller like so: self.match.minPlayers = 2; self.match.maxPlayers = 2; self.match.defaultNumberOfPlayers = 2; let mmVC = GKTurnBasedMatchmakerViewController(matchRequest: match); mmVC.turnBasedMatchmakerDelegate =

How is GKTurnBasedMatchmaker used?

我的梦境 提交于 2020-02-08 07:51:26
问题 I'm trying to create a simple turn based 2 player game, but am struggling to understand how to use GKTurnBasedMatchmaker Here's the steps I have so far: Authenticate Local Player Make my view controller the GKTurnbasedMatchmakerViewControllerDelegate Present the matchmaking view controller like so: self.match.minPlayers = 2; self.match.maxPlayers = 2; self.match.defaultNumberOfPlayers = 2; let mmVC = GKTurnBasedMatchmakerViewController(matchRequest: match); mmVC.turnBasedMatchmakerDelegate =

How to make connection over WiFi when working with Gamekit?

江枫思渺然 提交于 2020-02-01 04:26:19
问题 I want to make connection between two devices over WiFi using GameKit. Apple's documentation says If an Internet connection is chosen, your application must dismiss the peer picker dialog and present its own user interface to complete the connection. This is what i do - (void)peerPickerController:(GKPeerPickerController *)picker didSelectConnectionType:(GKPeerPickerConnectionType)type { if (type == GKPeerPickerConnectionTypeOnline) { picker.delegate = nil; [picker dismiss]; [picker

Definitive answer to what playersToInvite is for

梦想的初衷 提交于 2020-01-16 04:53:28
问题 The Game Center documentation indicates that the playersToInvite parameter is non-nil when your application is launched directly from the Game Center application to host a match. A few people have asked how this works exactly, i.e. there doesn't appear to be a way to select a friend from the Game Center application and invite them to play from Game Center; it only works when you invite in-game. Is this documentation dated or is there a secret way to start a game-specific match from Game

Connect 3rd Device using GameKit

别等时光非礼了梦想. 提交于 2020-01-13 07:17:48
问题 I am using GameKit on a basic level right now. I am able to connect two devices and send messages between them. I have 3 devices, we'll call them device A, B and C. I am able to connect A to B, A to C, and B to C, as individual setups. If I connect A to B, then attempt to connect B to C, Device C will show that Device B is available, but device B continues to spin and say "Looking for available iPod, iPhones..." In peerPickerController:sessionForConnectionType: , when I am attempting to

Connect 3rd Device using GameKit

◇◆丶佛笑我妖孽 提交于 2020-01-13 07:17:06
问题 I am using GameKit on a basic level right now. I am able to connect two devices and send messages between them. I have 3 devices, we'll call them device A, B and C. I am able to connect A to B, A to C, and B to C, as individual setups. If I connect A to B, then attempt to connect B to C, Device C will show that Device B is available, but device B continues to spin and say "Looking for available iPod, iPhones..." In peerPickerController:sessionForConnectionType: , when I am attempting to

GKMatchmaker findMatchForRequest invite never received

喜你入骨 提交于 2020-01-11 08:51:17
问题 I'm trying to invite nearby players to a match, but the invite is either never sent or never received. GKMatchMaker startBrowsingForNearbyPlayersWithHandler works and returns nearby players that are on same wifi, but then I use findMatchForRequest and it returns a match without any players, and the players I try to invite never receive an invite notification. Here is my code. I start by authenticating the local player: GKLocalPlayer.localPlayer.authenticateHandler= ^(UIViewController

Is there a way to update matchData in a GKTurnBasedMatch without sending out “Your Turn” push notifications?

落爺英雄遲暮 提交于 2020-01-11 06:51:14
问题 If my understanding is correct, the only way to update the matchData property of a GKTurnBasedMatch mid-turn is [_currentMatch endTurnWithNextParticipant:_currentParticipant matchData:matchData completionHandler:nil]. This works well if the Game Center player only has the game installed on one device because the notification is delivered to the device as a message to the app. Thus, the notification can be hidden while the user is currently playing his turn. However, if the user has the game