views:

118

answers:

3

Hi

Anyone has any experience with GameKit GKErrorDomain Code 3? I receive the error message when I try to upload a score to a leaderboard in the Sandbox. The iOS reference library just says that Indicates that an error occurred when communicating with Game Centre The Here is the full error message:

Error Domain=GKErrorDomain Code=3 "The requested operation could not be completed due to an error communicating with the server." UserInfo=0x75e4eb0 {NSUnderlyingError=0x7531e00 "The operation couldn’t be completed. status = 5053", NSLocalizedDescription=The requested operation could not be completed due to an error communicating with the server

The environment:

  • The request is being made from the 4.1 Simulator
  • GameKit has authenticated the local player who has logged into the Sandbox
  • The leaderboard with the name "Standard" has been created on iTunes connect
  • I can browse the web in the simulator

Here is the code I use to upload the score

    GKScore *scoreReporter = [[[GKScore alloc] initWithCategory:@"Standard"] autorelease];
    scoreReporter.value = 10;
    [scoreReporter reportScoreWithCompletionHandler:^(NSError *error) 
     { 
    if (error != nil) 
         {
             // handle the reporting error
             NSLog(@"An error occured reporting the score");
         }
         else 
         {
             NSLog(@"The score was reported successfully");
         }
     }];
A: 

One reason (which is the reason that was affecting me) for GKDomainError Code 3 is if the Leaderboard Category Id specified in the initWithCategory message when initializing GKScore is incorrectly specified.

indi
A: 

It's easier to track down if you print out the error. Etc:

NSLog(@"An error occured reporting the score: %@", error);
jramer
A: 

Have the same problem recently. It was returning error on simulator, but worked fine on the device. Probably, it just doesn't work in simulator.

Wicharek