I have the following code:
if(tappedItem.match.status == GKTurnBasedMatchStatusEnded){
NSLog(@"Participants %@", [tappedItem.match.participants description]);
[tappedItem.match rematchWithCompletionHandler:^(GKTurnBasedMatch *match, NSError *error) {
if (error) { NSLog(@"%@", error);
} else {
[[GameKitHelper sharedGameKitHelper] setMatch:tappedItem.match];
[[NSNotificationCenter defaultCenter] postNotificationName:ShowGameScreen object:tappedItem.match];
}
}];
}
I've got a number of people Beta testing it via TestFlight with sandbox enabled, but for some reason I get the following error when trying to rematch:
{GKServerStatusCode=5121, NSLocalizedDescription=The requested operation could not be completed because the player is invalid., NSUnderlyingError=0x17045cdd0 "The operation couldn’t be completed. status = 5121, Invitation from: 224002977 to: 225851510 is not allowed because they are neither friends nor have recently played"}
The match was ended properly, so it's not that:
[_match endMatchInTurnWithMatchData:data scores:scores achievements:nil completionHandler:^(NSError *error) {}];
I'm thinking this is an isolated issue with Sandbox, but unless I can test it I'm not confident that it will work in the once released.