在更新到iOS 8.3和Swift 1.2之后,endTurnWithNextParticipants不会触发receiveTurnEventForMatch [英] endTurnWithNextParticipants doesn't trigger receivedTurnEventForMatch after update to iOS 8.3 and swift 1.2

查看:68
本文介绍了在更新到iOS 8.3和Swift 1.2之后,endTurnWithNextParticipants不会触发receiveTurnEventForMatch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从更新到iOS8.3以来,有没有人注意到回合制比赛通知的任何变化?在我的应用中,当我调用endTurnWithNextParticipants时,在升级之前,这导致通知发送给对手,这将触发在其设备上调用receiveTurnEventForMatch,但情况不再如此.当对手终止应用程序并重新启动应用程序时,他们可以看到轮到他们了,因此游戏中心中的比赛已按照参与顺序正确更新,但这似乎不再动态生效.

Has anyone noticed any changes to turn based match notifications since updating to iOS8.3? In my app when I call endTurnWithNextParticipants, prior to the upgrade, this was resulting in a notification being sent to the opponent which would trigger a receivedTurnEventForMatch being invoked on their device but this no longer is the case. When the opponent terminates the app and restarts it they can see it is their turn so the match in game centre was correctly updated with the order of participation but this doesn't seem to take effect dynamically any more.

还有其他人看到吗?我希望这只是游戏中心沙盒环境中的一个临时故障.

Anybody else see this? I'm hoping it's just a temporary glitch in game centre sandbox environment.

我向Apple提出了一个错误报告,以查看它是否确实是一个错误,或者我们需要了解的iOS8.3中是否存在一些未记录的行为更改.

推荐答案

更新: 苹果已经对错误报告做出了回应:

Update: Apple has responded to the bug report:

请在iOS 8.4 beta 4(内部版本:12H4125a)和以下版本中验证此问题: 使用您的 http://bugreport.apple.com/更新您的错误报告. 结果.

Please verify this issue with iOS 8.4 beta 4 (Build: 12H4125a) and update your bug report at http://bugreport.apple.com/ with your results.

iOS 8.4 beta 4(内部版本:12H4125a) https://developer.apple.com/ios/download/发表于:2015年6月9日

iOS 8.4 beta 4 (Build: 12H4125a) https://developer.apple.com/ios/download/ Posted: June 9th, 2015

很遗憾,我无法在我的设备上安装iOS 8.4 beta 4,并且无法告诉您它是否已修复.如果您有任何机会,请分享.

Unfortunately I am not able to install iOS 8.4 beta 4 on my devices and can't tell you whether it's fixed now. If anybody of you has this opportunity, please share.

我已向Apple提交了有关此问题的错误报告,并将在他们做出回应后在此处发布更新.

I have submitted a bug report to Apple regarding this issue and will post updates here when they have responded.

我的回合制游戏具有此解决方法.看起来很糟糕,但它又能正常工作-也许对您有帮助.

My turn-based game has this workaround. Looks terrible, but it's working again – maybe it helps you.

- (void)sendGameStateWith:(NSMutableDictionary *)data
{
    if (self.match) {
        NSData *matchdata = [NSKeyedArchiver archivedDataWithRootObject:data];

        GKTurnBasedParticipant *opponent = [self.match.participants objectAtIndex:0];
        GKTurnBasedParticipant *localPlayer = [self.match.participants objectAtIndex:1];
        if ([self.localPlayer.playerID isEqualToString:opponent.playerID]) {
            opponent = [self.match.participants objectAtIndex:1];
            localPlayer = [self.match.participants objectAtIndex:0];
        }

        // HINT: Remove this workaround when Apple has fixed it. 
        [self.match saveCurrentTurnWithMatchData:matchdata completionHandler:^(NSError *error) {
            if (error) {
                NSLog(@"Error on saveCurrentTurnWithMatchData");
                [self sendGameStateWith:data];

            } else {
                [self.match endTurnWithNextParticipants:[NSArray arrayWithObjects:opponent, localPlayer, nil] turnTimeout:turnTimeout matchData:matchdata completionHandler:^(NSError *error) {
                    if (error) {
                        NSLog(@"Error: Send Game Center state");
                    } else {
                        NSLog(@"Sent Game Center state");
                    }
                }];
            }
        }];
    }
}

这篇关于在更新到iOS 8.3和Swift 1.2之后,endTurnWithNextParticipants不会触发receiveTurnEventForMatch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆