I've been working on a iOS game and our users asked for Facebook support which is working right now. The only problem is that after Facebook is done and gave us the information we needed Game Center won't cooperate and during the match invite stays stuck on 'waiting...' about 30% of the times.
After the game received the Facebook request and has it's data it checks if the user is authenticated in Game Center and only if he/she is it will call the following code to create the match
-(void)createMatchWithFB:(NSString*)playerID andViewController:(UIViewController *)viewController andDelegate:(id<GCHelperDelegate>)theDelegate
BOOL bResult = FALSE;
bResult = [self isGameCenterAvailable];
presentingViewController = viewController;
if(bResult == YES)
GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
request.minPlayers = 2;
request.maxPlayers = 2;
request.playersToInvite = [NSArray arrayWithObject:playerID];
request.inviteMessage = @"Want to play some WordMemory?";
request.inviteMessage = @"Zin in een potje WordMemory?";
request.inviteeResponseHandler = ^(NSString *playerID, GKInviteeResponse response)
NSLog(@"request response %@ %i",playerID,response);
GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
mmvc.matchmakerDelegate = self;
[viewController presentModalViewController:mmvc animated:YES];
Even though the Game Center dialog is stuck on 'waiting...' I can still start the request and the other player does get it. But the match never starts...
Here's a screenshot to farther explain what's going on, http://i.imgur.com/BSnN4.jpg the iPad tried to start the match after the iPod send the request via Facebook.
Does anyone have any idea what causes this?
After talking to Apple directly via the Bug Report system it has been deemed as expected behaviour. Though this isn't really expected it does however rely on undocumented behaviour to work.
Game-center only accepts invites form people on Game-Center whom are friend on Game-Center with the person requesting the invite. Since there is no guarantee that the same Facebook friends are friends on Game-Center there is no guarantee that these two user can start a game together.
The support for this functionality has been removed and should not be attempted by any other developer unless Apple changes it's policy on external social network which will most likely NOT happen as their behaviour might change over time.
Jan 09 at 05:16