Voldemort Voldemort - 1 year ago 83
Objective-C Question

How can the invitee, programmatically, decline a Game Center invitation?

When sending an invitation with your own custom interface, you install an invitee response handler:

request.inviteeResponseHandler = ^(NSString *playerID, GKInviteeResponse response) {
NSLog(@"INVITEE ANSWERED: %d", response);

From the invitee point of view, they receive a
object. If they start match using this object, then the inviter will receive a
value in their response handler.

One type of response is
, implying that there is a way to decline a
object. How can the invitee, programmatically, decline an invitation?

iOS 7.

Answer Source

For a GKTurnBasedMatch, you can call declineInvite right on the match itself!

God knows why they didn't make it that easy with GKMatch. I don't know how to do this for a regular GKMatch, which is maddening.

Best of luck!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download