Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7501295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:28:54+00:00 2026-05-29T20:28:54+00:00

Does GameKit allow you to invite a specific Game Center friend to a match,

  • 0

Does GameKit allow you to invite a specific Game Center friend to a match, programmatically, i.e. without presenting the GC ViewController? The following handleInviteFromGameCenter documentation seems to imply that you can populate GKMatchRequest.playersToInvite and use it with [GKTurnBasedMatch findMatchForRequest]:

When your delegate receives this message, your application should create a new GKMatchRequest object and assign the playersToInvite parameter to the match request’s playersToInvite property. Then, your application can either call the GKTurnBasedMatch class method findMatchForRequest:withCompletionHandler: to find a match programmatically or it can use the request to instantiate a new GKTurnBasedMatchmakerViewController to show a user interface to the player.

But I’m finding that when findMatchForRequest calls my completion block with the populated match, the GameCenter ID I passed to it is not set as the 2nd player. Instead it’s empty and the status is “matching”. And therefore, when I call endTurnWithNextParticipant, it succeeds, but the invite isn’t received on my 2nd device. This illustrates what I’m doing:

GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease]; 
request.minPlayers = 2;
request.maxPlayers = 2;
request.playersToInvite = [NSArray arrayWithObjects: otherPlayerGCID,nil ];

[GKTurnBasedMatch findMatchForRequest:request 
                  withCompletionHandler:^(GKTurnBasedMatch *match, NSError *error) 
{
    if (error) 
        NSLog(@"returned from fimdmatch but with error");
    else if (match != nil) {
        NSLog(@"match returned success and match populated");
        NSArray* otherPlayers = [match participants];
        if (otherPlayers.count>1) {
           NSData* placeholder = [@"no data" dataUsingEncoding:NSUTF8StringEncoding];
           [match endTurnWithNextParticipant:[otherPlayers objectAtIndex:1] 
                  matchData:placeholder 
                  completionHandler:^(NSError *error) 
           {
              if (error) 
                 NSLog(@"returned from END TURN but with error");
              else
                 NSLog(@"returned from  END TURN successfully");
           }];     

        }
     }
     else
        System::log("match returned success but match NOT populated");
}];

And like the person who seems to be having a similar problem here Game Center inviting friends progammatically, if I insert a call to the view controller, in my case GKTurnBasedMatchmakerViewController, all seems to work.

Thanks.

UPDATED:
I did see in an Apple Developer’s presentation on turn-based GC, a mention of something like, “If you want to invite a GC friend, we ask that you go through the GC view controller.

Any insight appreciated. Thanks again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:28:55+00:00Added an answer on May 29, 2026 at 8:28 pm

    Wanted to share what I learned on this: As of iOS 5 there is not a way to invite a game center friend to play a game without going through the pre-defined GKTurnBasedMatchmakerViewController flow, which is optimized for starting a match in real time, guiding the user through three different screens.

    After being urged to do so by apple dev support, I did submit a feature request to be able to invoke a simple, one-page view controller that would allow the user to send an invite / “recommend game” message via game center.

    UPDATE FOR iOS 6:
    Happy to report that it looks like this has been addressed in iOS 6. My original programmatic (non-UI) example above now works as originally expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does the JavaScript below allow a webpage load quicker opposed to the a standard
Does Bluetooth p2p connectivity work on iPhone simulator? I want to test GameKit connection
Does the following function cause stack overthrow eventually? var isFinish= false; function foo(){ //
Does Facebook like button differs from the URL with www and without it? If
Does anyone how to set a custom library version, when compiling with the gmcs
Does $this->db->insert_batch(); insert with 1 table connection or does it insert each row separately
Does anyone know, what an XMLHttpRequest enables a web page to do, which cannot
Does any one know how I can have this happen in a windows phone
Does anybody know what i mean? In fullscreen mode of the new camera app
Does ScanResult.level (signal level) have a max and min value? I want to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.