Skip to content

Instantly share code, notes, and snippets.

@timrisi
Created January 18, 2012 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timrisi/1631819 to your computer and use it in GitHub Desktop.
Save timrisi/1631819 to your computer and use it in GitHub Desktop.
PlayersToInvite
-(void)handleInviteFromGameCenter:(NSArray *)playersToInvite
{
NSLog(@"New invite");
[presentingViewController dismissModalViewControllerAnimated:YES];
GKMatchRequest *request = [[GKMatchRequest alloc] init];
request.playersToInvite = playersToInvite;
request.maxPlayers = 2;
request.minPlayers = 2;
GKTurnBasedMatchmakerViewController *viewController = [[GKTurnBasedMatchmakerViewController alloc] initWithMatchRequest:request];
viewController.showExistingMatches = NO;
viewController.turnBasedMatchmakerDelegate = self;
[presentingViewController presentModalViewController:viewController animated:YES];
}
public override void HandleInviteFromGameCenter(GKPlayer[] playersToInvite)
{
GCHelper.presentingViewController.DismissModalViewControllerAnimated(true);
GKMatchRequest request = new GKMatchRequest();
request.PlayersToInvite = playersToInvite;
request.MinPlayers = 2;
request.MaxPlayers = 2;
GKTurnBasedMatchmakerViewController viewController = new GKTurnBasedMatchmakerViewController(request);
viewController.ShowExistingMatches = false;
viewController.Delegate = new GKViewControllerDelegate();
GCHelper.presentingViewController.PresentModalViewController(viewController, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment