Do not send queue with GKTurnBasedParticipant iOS 5 iphone

I am developing an application for the iPad and iPhone with the Game Center feature. The game is sending correctly, one participant is switching from iPad 2 IOS 6, but when I try to send a queue to another participant with iPhone 4 IOS 5, the following error appears:

<GKTurnBasedParticipant 3d8e50 - id:(null) status:Matching outcome:None lastTurn:(null)> 2013-03-14 23:56:22.030 [453:707] ERROR::::::Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x7a81170 {NSUnderlyingError=0x3f4220 "The operation couldn't be completed. status = 5008, missing required key: turns", NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server.} 2013-03-14 23:56:22.031 [453:707] Oops, there was a problem. Try that again. 

I use the following method, which works fine on iOS 6:

 [currentMatch endTurnWithNextParticipant:nextParticipant matchData:data completionHandler:^(NSError *error) { if (error) { NSLog(@"%@", error); NSLog( @"Oops, there was a problem. Try that again."); } else { NSLog(@"Your turn is over."); } }]; 

Error number 3 is GKErrorCommunicationsFailure, but I canโ€™t understand what is happening!

I logged in correctly when the application starts with Game Center

+4
source share
1 answer

This error always occurs when you work with Simulator instead of a device, but sometimes it appears on the device due to Push Notification failure. Make sure that the device accepts Push notifications.

UPDATED

I recently realized that Game Center does not send push notifications to devices that do not have a SIM card inserted.

0
source

Source: https://habr.com/ru/post/1468845/


All Articles