iosobjective-cgame-centergkmatchmaker

Only use Automatch in Gamecenter


How do you remove the invite friend button from a GKMatchmakerViewController?

When printing all of the subviews in it I only see the navigation bar.

I am presenting it like this:

GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc] initWithMatchRequest:request];

mmvc.matchmakerDelegate = self;

[viewController presentViewController:mmvc animated:YES completion:nil];

Solution

  • Unfortunately it isn't possible, i looked into removing the quick match button myself and found it couldn't be done.

    You can however set up your own custom invite screen, check out the 'Implementing a Custom Match User Interface' section in the 'Real Time Matches' section of the iOS documentation. There are too many code examples to show here I'll just have to supply the description and link:

    https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/Matchmaking/Matchmaking.html

    DESCRIPTION

    Implementing a complete custom match interface can be as simple as displaying a network progress indicator until auto-matching completes, or as sophisticated as implementing a complete custom view controller that replicates the standard behavior. The latter is potentially a significant investment in programming time, as it needs to include support for all of the following:

    • Inviting specific players into a match
    • Listening for responses from invited players
    • Looking for nearby players (available via Wi-Fi or Bluetooth)