gkturnbasedmatch

Handle invitation to GKTurnBasedMatch without game center view controllers

ぐ巨炮叔叔 提交于 2019-12-04 08:18:53
I am working on a simple turn-based word game, and I'm having a difficult time figuring out how invitations are working. When user A invites user B to a game, I want user B to be able to see this game in my custom match interface (ie a screen where all of user B's games are listed). Things are fine if user B clicks on the notification when he is invited to a game, but I still want the game to be visible through my own interface if user B just navigates to the app on his own. Whenever this match interface screen appears, I am using [GKTurnBasedMatch loadMatchesWithCompletionHandler:] to get all

IOS Game Center GKLocalPlayerListener

只谈情不闲聊 提交于 2019-12-03 06:35:19
I was trying to implement an event listener in a turn based game so a player can receive when his turn is active or when he is invited by a friend. GKTurnBasedEventHandler is deprecated in IOS 7 and i read in the documentation that i should use GKLocalPlayerListener; but that's the extend of it. Is there someone who used it already, because there is no info anywhere. This is what i tried before, and it does not work. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];

handleTurnEventForMatch:didBecomeActive: callbacks only arriving some of the time

只愿长相守 提交于 2019-12-01 16:39:35
This is a follow-up to this question . If you are not receiving any callbacks to handleTurnEventForMatch:didBecomeActive: , try the answer there. In my game, I am only receiving turn event notifications some of the time. But if I go back to the matchMakerViewController and re-load the match, the state is always correct. My game uploads the turn state multiple times during each turn. Anecdotally, it seems that if the other device receives one notification for an opponent's turn, it is less likely to receive further notifications for that same turn. However, this is not 100%. In general, my

handleTurnEventForMatch:didBecomeActive: callbacks only arriving some of the time

ε祈祈猫儿з 提交于 2019-12-01 16:02:32
问题 This is a follow-up to this question. If you are not receiving any callbacks to handleTurnEventForMatch:didBecomeActive: , try the answer there. In my game, I am only receiving turn event notifications some of the time. But if I go back to the matchMakerViewController and re-load the match, the state is always correct. My game uploads the turn state multiple times during each turn. Anecdotally, it seems that if the other device receives one notification for an opponent's turn, it is less

How do I reply to a GKTurnBasedExchange? GKLocalPlayerListener delegate receivedExchangeReplies is called intermittently

时光怂恿深爱的人放手 提交于 2019-12-01 12:12:32
There are a handful of posts discussing how Game Center's push notifications were fairly unreliable in the sandbox. However, the sandbox is obfuscated with iOS 9 so, I'm not sure why my Game Center push notifications are so unreliable. When I reply to the active exchange, the sender is rarely notified. [exchange replyWithLocalizableMessageKey:@"EXCHANGE_REPLY" arguments:@[] data:data completionHandler:^(NSError *error) { if (error) { NSLog(@""); } }]; On the senders device, if I refresh the match data, I'll see a pending reply. If I process the reply, everything works. The same goes for this

How to list all available GKTurnBasedMatches for a player?

↘锁芯ラ 提交于 2019-12-01 06:46:34
I'm building a game using Game Center's turn based matches. I want to display a list of all the available matches. I've tried using loadMatchesWithCompletionHandler() , but the array of games returns as nil , and the error also returns as nil . There are some ongoing matches. This is what I have so far: func authenticateLocalUser() { if !gameCenterAvailable { return } let player = GKLocalPlayer.localPlayer() if player.authenticated == false { player.authenticateHandler = {(viewController, error) -> Void in if viewController != nil && self.presentingViewController != nil { self

How to list all available GKTurnBasedMatches for a player?

一个人想着一个人 提交于 2019-12-01 05:10:40
问题 I'm building a game using Game Center's turn based matches. I want to display a list of all the available matches. I've tried using loadMatchesWithCompletionHandler() , but the array of games returns as nil , and the error also returns as nil . There are some ongoing matches. This is what I have so far: func authenticateLocalUser() { if !gameCenterAvailable { return } let player = GKLocalPlayer.localPlayer() if player.authenticated == false { player.authenticateHandler = {(viewController,

Gamecenter ios 9 GameCenter GKLocalPlayerListener methods not called

。_饼干妹妹 提交于 2019-11-27 23:17:07
This is about GameCenter . Since "the GKLocalPlayerListener protocol inherits the methods from GKChallengeListener , GKInviteEventListener , and GKTurnBasedEventListener . In order to handle multiple events" and "do not implement GKChallengeListener , GKInviteEventListener , and GKTurnBasedEventListener directly; implement GKLocalPlayerListener instead. You can listen for, and handle multiple events using GKLocalPlayerListener " (these are from apple docs). One would expect that after registering the GKLocalPlayerListener after the GKLocalPlayer.localPlayer() has been authenticated, then all

Gamecenter ios 9 GameCenter GKLocalPlayerListener methods not called

霸气de小男生 提交于 2019-11-27 04:40:44
问题 This is about GameCenter . Since "the GKLocalPlayerListener protocol inherits the methods from GKChallengeListener , GKInviteEventListener , and GKTurnBasedEventListener . In order to handle multiple events" and "do not implement GKChallengeListener , GKInviteEventListener , and GKTurnBasedEventListener directly; implement GKLocalPlayerListener instead. You can listen for, and handle multiple events using GKLocalPlayerListener " (these are from apple docs). One would expect that after