endTurnWithNextParticipants doesn't trigger receivedTurnEventForMatch after update to iOS 8.3 and swift 1.2

后端 未结 4 1550
长情又很酷
长情又很酷 2020-12-13 22:14

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

4条回答
  •  再見小時候
    2020-12-13 23:11

    Update: Apple has responded to the bug report:

    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 (Build: 12H4125a) https://developer.apple.com/ios/download/ Posted: June 9th, 2015

    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.


    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");
                        }
                    }];
                }
            }];
        }
    }
    

提交回复
热议问题