Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在应用商店中创建重定向到我的游戏的链接?_Ios_Swift - Fatal编程技术网

Ios 如何在应用商店中创建重定向到我的游戏的链接?

Ios 如何在应用商店中创建重定向到我的游戏的链接?,ios,swift,Ios,Swift,因此,我有一个共享按钮,我想添加一个指向共享文本的链接,该链接重定向到应用商店上的我的游戏,但由于我的应用不在应用商店上,因此我必须以编程方式生成它。我该怎么做 func share() { let highscore = UserDefaults.standard.integer(forKey: "highscore") let activityVC = UIActivityViewController(activityItems: ["I just scored a

因此,我有一个共享按钮,我想添加一个指向共享文本的链接,该链接重定向到应用商店上的我的游戏,但由于我的应用不在应用商店上,因此我必须以编程方式生成它。我该怎么做

    func share() {
    let highscore = UserDefaults.standard.integer(forKey: "highscore")
    let activityVC = UIActivityViewController(activityItems: ["I just scored a new Highscore of \(highscore), can you beat me? /*Here should be the link to the game on the App Store*/"], applicationActivities: nil)
    activityVC.popoverPresentationController?.sourceView = self.view

    self.present(activityVC, animated: true, completion: nil)
}

您可以在链接中使用iTunesConnect的ID。只需在iTunesConnect中为你的应用添加一个条目,你就可以在url中使用iTunesConnect为你的应用生成的ID。这将允许您在上传到应用商店之前创建链接


下面是一个链接,用于在iTunesConnect上创建应用商店条目后如何创建url:

谢谢你的回答,我会尝试一下,有没有办法测试链接是否有效?我很确定当你单击链接时,它会打开应用商店,并说“找不到应用”之类的话,但这意味着它正在工作