Domanda

I'm creating a live multiplayer game with 2 players through game center.

I followed Ray Wenderlich's tutorial on game center and I tried to set up the invite friends. I set up the call back just like apple said:

    if ([GKLocalPlayer localPlayer].isAuthenticated) {
        [GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite *acceptedInvite, NSArray *playersToInvite) {
            NSLog(@"Received invite");
            self.pendingInvite = acceptedInvite;
            self.pendingPlayersToInvite = playersToInvite;
            [self inviteReceived];
        };
    } 

I even tested whether the block property is actually set. It is.

I'm in sandbox with a simulator and an iPhone 5 both at iOS7. I couldn't receive ANY invitations (see screenshot). I enabled notification center, checked accept invitation in settings, but the block is never called. Random match worked fine though.

Fail message

È stato utile?

Soluzione

Solved it by borrowing someone else's device instead of using the simulator.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top