Game Center URL scheme

前端 未结 3 1691
难免孤独
难免孤独 2020-12-25 13:45

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

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


        
3条回答
  •  被撕碎了的回忆
    2020-12-25 13:59

    Only use this routine .

        - (void)showGameCenter
    {
    
    GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];
    
        if (gameCenterController != nil)
        {
            gameCenterController.gameCenterDelegate = self;
            gameCenterController.viewState = GKGameCenterViewControllerStateDefault;       
            [self presentViewController: gameCenterController animated: YES completion:nil];
    
        }
    }
    

提交回复
热议问题