【问题标题】:Cannot receive friend invites in Game center游戏中心收不到好友邀请
【发布时间】:2014-03-23 07:18:57
【问题描述】:

我正在通过游戏中心创建一个有 2 名玩家的实时多人游戏。

我按照 Ray Wenderlich 的游戏中心教程,尝试设置邀请好友。我就像苹果说的那样设置了回调:

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

我什至测试了 block 属性是否真的被设置了。是的。

我在 iOS7 的沙盒中,有一个模拟器和一个 iPhone 5。我无法收到任何邀请(见截图)。我启用了通知中心,在设置中检查了接受邀请,但从未调用该块。不过随机匹配效果很好。

【问题讨论】:

    标签: ios cocoa-touch game-center multiplayer


    【解决方案1】:

    通过借用别人的设备而不是使用模拟器来解决它。

    【讨论】:

    • 你绝对是对的!我用模拟器尝试了几个小时,但什么也没发生。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多