代码之家  ›  专栏  ›  技术社区  ›  typeoneerror

playersToInvite的最终用途

  •  1
  • typeoneerror  · 技术社区  · 14 年前

    游戏中心文档表明

    playersToInvite 启动应用程序时 用于主持匹配的应用程序。

    有几个人问过这是如何工作的,也就是说,似乎没有办法从游戏中心应用程序中选择朋友并邀请他们玩游戏 游戏中心;它只在你邀请游戏中使用。此文档是否有日期,或者是否有从game Center开始特定于游戏的比赛的秘密方法?我想测试一下 inviteHandler 但是我无法确定这个参数是如何传递给应用程序的。

    [GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite *acceptedInvite, NSArray *playersToInvite)
    {
        // clean up games in progress here
        if (acceptedInvite)
        {
            NSLog(@"acceptedInvite %@", acceptedInvite);
            // The acceptedInvite parameter is non-nil when the application receives an 
            // invitation directly from another player.
            GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithInvite:acceptedInvite] autorelease];
            mmvc.matchmakerDelegate = self;
            [self disableHomeUI];
            [self presentModalViewController:mmvc animated:YES];
        }
        else if (playersToInvite)
        {
            NSLog(@"playersToInvite %@", playersToInvite);
            // playersToInvite parameter is non-nil when your application is launched 
            // directly from the Game Center application to host a match
            [self disableHomeUI];
            [self doPresentMatchMakerUIWithPlayersToInvite:playersToInvite];
        }
    };
    
    4 回复  |  直到 14 年前
        1
  •  1
  •   Joseph Tura    14 年前

    我认为这些文件没有反映当前的情况。据我所知,目前这款游戏中心应用甚至没有提供邀请朋友玩游戏的界面。

    另外,查看开发者论坛(显然你有)。库比蒂诺的人似乎认为这是不可能的。所以。。。

        2
  •  1
  •   typeoneerror    14 年前

    在我的应用程序Cee lo投入生产之后 playersToInvite

        3
  •  1
  •   Mark Johnson    11 年前

    在那里

    游戏中心应用程序 ->游戏选项卡 ->您的游戏 ->选择播放器

    这将向另一个播放机发送推送通知邀请。游戏可以 必须在任一设备上运行。从iOS7开始。

    游戏中心应用程序 ->朋友选项卡 ->点击朋友 ->点击右上角的“…”按钮

        4
  •  0
  •   Mark Allen    13 年前

    我可能错了,但我认为只是“模拟器”不能邀请特定的朋友玩。

    我已经能够使用2个或更多运行在沙盒中的iphone来邀请特定的朋友来玩,并且它在调试invite处理程序代码方面非常有效。

    如另一张海报所述,此时似乎没有邀请特定朋友从game Center玩特定游戏的方式。

    玩得开心!