我认为最好的方法,可能是唯一的方法是与[[UIApplication sharedApplication] openURL:...]一起使用URL方案。但我无法找到游戏中心的URL方案。如何从我的应用程序运行iPhone GameCenter应用程序?
6
A
回答
16
您可以通过使用gamecenter:
URL方案推出的Game Center应用程序:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"gamecenter:"]];
-3
尝试使用Apple示例代码。它解释了您的应用程序如何与gamecenter一起工作。 http://developer.apple.com/library/ios/#samplecode/GKTapper/Introduction/Intro.html
6
在iOS的6.0有一个新的方式相当冷静使用GKGameCenterViewController显示游戏中心。
使用它您的视图控制器必须作为一个代表到GKGameCenterViewController:
@interface ViewController : UIViewController <GKGameCenterControllerDelegate>
然后用于显示游戏中心观点:
- (void)showGameCenter
{
GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];
if (gameCenterController != nil)
{
gameCenterController.gameCenterDelegate = self;
[self presentViewController: gameCenterController animated: YES completion:nil];
}
}
//Called when the player is done interacting with the GKGameCenterViewController
- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController
{
[self dismissViewControllerAnimated:YES completion:nil];
}
如果它的iOS 5.0下的用户,你只能像以前说的那样使用URL方案。
相关问题
- 1. 从iPhone上运行应用程序隐藏应用程序
- 2. 如何从iPhone中的其他应用程序运行一个应用程序?
- 3. 当我在运行iPhone应用程序
- 4. 在应用程序上运行iphone应用程序
- 5. 从我的iPhone应用程序打开Spotify应用程序
- 6. 我如何运行Spring应用程序?
- 7. 如何从Web应用程序加载iPhone应用程序
- 8. 如何使我的iPhone应用程序通用(iPhone - iPad)应用程序?
- 9. 如何从我的应用程序启动iPhone设置应用程序?
- 10. 如何在iphone中运行我的应用程序背景?
- 11. 如何从iPhone内部调用iPhone应用程序调用应用程序
- 12. iPhone:如何从你的应用程序
- 13. 从我的应用程序中的iPhone
- 14. 如何从当前的应用程序运行独立的应用程序?
- 15. iphone XMPP应用程序运行背景
- 16. 运行应用程序在越狱iphone
- 17. iPhone应用程序运行崩溃
- 18. iphone应用程序在后台运行?
- 19. 从Web应用程序运行特定应用程序
- 20. 从Windows XAML应用程序运行控制台应用程序
- 21. 从.NET 3.5应用程序运行.NET 4.0应用程序
- 22. 无法从我的iPhone应用程序
- 23. 如何从iPhone应用程序运行外部脚本?
- 24. 从iphone应用程序的信用卡处理应用程序
- 25. 如何从我的iPhone应用程序进行付款?
- 26. 如何从控制台应用程序运行程序?
- 27. 我的iPhone应用程序的最小应用程序大小?
- 28. 如何获取iPhone应用程序的应用程序链接
- 29. iphone应用程序崩溃,同时应用程序运行一个线程asyc
- 30. 如何从iPhone应用程序打印?
这不是我所需要的,我知道如何与游戏中心合作,但我的客户希望有可能将用户从他的应用程序直接重定向到GameCenter应用程序 – 2011-04-20 07:19:55