I am following a tutorial here . Multiplayer Game iOS
I am using following code from above tutorial for Match Making
GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
request.minPlayers = minPlayers;
request.maxPlayers = maxPlayers;
request.playersToInvite = pendingPlayersToInvite;
GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
mmvc.matchmakerDelegate = self;
[presentingViewController presentModalViewController:mmvc animated:YES];
When I search for other players using Play Now option, the GKMatchmakerViewController
dismissed immediately delegating matchmakerViewController:didFailWithError
with following error.
Error Domain=GKErrorDomain Code=3 "The requested operation could not be
completed due to an error communicating with the server." UserInfo=0x2081d8d0
{GKServerStatusCode=5001, NSUnderlyingError=0x2086c560 "The operation couldn’t be
completed. (GKServerErrorDomain error 5001.)", NSLocalizedDescription=The requested
operation could not be completed due to an error communicating with the server.}
I have not been able to figure why is it happening so. The same code was previously able to search and find appropriate players but failed when fetching player aliases using
[GKPlayer loadPlayersForIdentifiers:match.playerIDs withCompletionHandler:^(NSArray *players, NSError *error)
with 'Could not communicate to server' error.
The code however, works fine on simulator.
I also got
Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x17007e4c0 {GKServerStatusCode=5001, NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server., NSUnderlyingError=0x170050140 "The operation couldn’t be completed. (GKServerErrorDomain error 5001.)
I think this is sandbox.gc.apple.com problem.. this question is one year but apple still have this problem sometime
Wish apple fix this soon.
I try on iPod touch and I got
Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0x176bec90 {NSErrorFailingURLKey=http://sandbox.gc.apple.com/WebObjects/GKInit.woa/wa/getBag?ix=1, NSErrorFailingURLStringKey=http://sandbox.gc.apple.com/WebObjects/GKInit.woa/wa/getBag?ix=1, NSLocalizedDescription=The request timed out.}