Ios 游戏中心URL方案

Ios 游戏中心URL方案,ios,game-center,Ios,Game Center,您可以使用以下方式从自己的应用程序打开游戏中心应用程序: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:"]]; 有没有办法在特定游戏的页面上打开它?我尝试了许多不同的组合。从iBook缺少这样一个功能、缺少文档以及我确信你已经发现互联网上缺少信息来看,我想说的是,可能有人必须通过暴力强迫URL来找到它(如果它设置为通过URL访问各个应用程序)。以下是我尝试过的一些方法: [[U

您可以使用以下方式从自己的应用程序打开游戏中心应用程序:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:"]];

有没有办法在特定游戏的页面上打开它?

我尝试了许多不同的组合。从iBook缺少这样一个功能、缺少文档以及我确信你已经发现互联网上缺少信息来看,我想说的是,可能有人必须通过暴力强迫URL来找到它(如果它设置为通过URL访问各个应用程序)。以下是我尝试过的一些方法:

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:id350536422"]];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:us/app/cheese-moon/id350536422"]];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:games/"]];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:350536422"]];
更新

我梳理了操作系统的内部结构,找到了Game Center的URL解析模式:

你需要精通正则表达式才能使用所有的正则表达式。以下是我为您打印的一些:

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:/me/account"]];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:/me/signout"]];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:/friends/recommendations"]];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:/games/recommendations"]];

Cirrostratus回答中使用的示例URL缺少一些位

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter://static.gc.apple.com/me/"]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter://static.gc.apple.com/friends/"]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter://static.gc.apple.com/games/"]];
这些URL在iOS 6和iOS 7上似乎对我有效。我假设如果您登录到一个sandbox游戏中心帐户,那么您就必须使用sandbox.gc.apple.com。我试图通过
/games/game/
/friends/player/
进入特定的游戏或好友页面,但我尝试的任何ID似乎都不起作用。对于好友URL,我转到一个空白的好友页面


即使有人真的弄明白了,因为它是没有文档记录的,苹果可能会在未来的任何时候更改,所以我不会将这样的URL硬编码到应用程序中。

只使用这个例程

    - (void)showGameCenter
{

GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];

    if (gameCenterController != nil)
    {
        gameCenterController.gameCenterDelegate = self;
        gameCenterController.viewState = GKGameCenterViewControllerStateDefault;       
        [self presentViewController: gameCenterController animated: YES completion:nil];

    }
}

除了使用这里概述的正常游戏套件交互之外,您还想做什么?虽然可以在应用程序中显示排行榜和成就,但我希望能够通过按钮打开实际的Game Center应用程序,并直接进入我的应用程序的“页面”。另一个原因是:如果用户未登录Game Center,并且正试图访问你应用程序中需要它的功能,将他们引导到游戏中心应用程序登录可能会有所帮助。Insightful。为特定游戏打开Game Center最可能的URL是:^/games/Game/+但是我扔掉了我能想到的所有东西,比如Game Center:/games/Game/cut The rope或使用ID,但什么都不起作用。如何在iOS7中实现这一点。在iOS7中,您必须转到设置应用程序才能从游戏中心注销。是否有一个url方案可以将我们带到设置页面?@Him我还没有在iOS7中签出这个。如果我这样做了,我会发回的。