How do I respond to a GKTurnBasedExchange? GKLocalPlayerListener delegate receivedExchangeReplies is called intermittent

There are several reports about how Game Center download notifications were rather unreliable in the sandbox. However, the sandbox is messed up with iOS 9, so I'm not sure why my alerts on clicking the Game Center button are so unreliable.

When I respond to an 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 update the mapping data, I will see a pending response. If I process the answer, everything will work.

The same applies to this method:

 - (void)sendExchangeToParticipants:(NSArray<GKTurnBasedParticipant *> *)participants data:(NSData *)data localizableMessageKey:(NSString *)key arguments:(NSArray<NSString *> *)arguments timeout:(NSTimeInterval)timeout completionHandler:(void(^__nullable)(GKTurnBasedExchange *exchange, NSError *error))completionHandler 

At this point, I think my best option is to run my own input notification logic to trigger an update of compliance data. It or I read that sending reminders is more reliable, although I believe that there are limitations regarding this.

Update

I tried to use only devices, not a simulator. Same question. This seems to be a pretty well known issue. This has even been noted in this book on page 766.

Update

Sending reminders did not help.

Update

Often, when I reply to an exchange, I get this error from GameKit.

 The connection to service named com.apple.gamed was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid. 
+2
source share

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


All Articles