游戏中心URL方案 [英] Game Center URL scheme

查看:146
本文介绍了游戏中心URL方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用以下方式从您自己的应用程序打开Game Center应用程序:

  [[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: /我/帐户]]; 
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@gamecenter:/ me / signout]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@gamecenter:/ friends / recommendations]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@gamecenter:/ games / recommendations]];


It's possible to open the Game Center app from your own app using:

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

Is there a way to open it on the page for a specific game?

解决方案

I've tried many different combinations. Judging by iBook's lack of such a feature, the lack of documentation and as I'm sure you've found—the lack of info on the internet—I'm going to say that someone'd probably have to either brute force the URL to figure it out (if it's set up to go to individual apps by URL at all). Here are some I've tried:

    [[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"]];

UPDATE

I combed through the internals of the OS and found out the URL resolution patterns for Game Center:

You'll need to be savvy with regex to use all of them. Here are some I've typed out for you:

    [[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"]];

这篇关于游戏中心URL方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆