从URL打开应用程序 - ios 10
问题描述:
我有一个小程序,我可以从其中下载另一个应用程序, 通过去ippa的plist, 从阅读到网址需要很多时间,当我看到应用程序开始下降, 有没有一种方式,它不需要时间点击?从URL打开应用程序 - ios 10
答
if let url = NSURL(string:<#Your url string here#>) {
if #available(iOS 10.0, *) {
// for ios 10
UIApplication.shared.open(url as URL, options: [:], completionHandler: nil)
}
else {
// for ios 9 or older
UIApplication.shared.openURL(url as URL)
}
}
+0
这是我的代码,但它不起作用 – Dvor
答
let appId = "xxx"
let storeUrl = String(format: "itms-apps://itunes.apple.com/app/id%@", arguments: [appId])
UIApplication.shared.openURL(URL(string: storeUrl)!)
+0
我的商店中的应用程序 – Dvor
很多从... – Dvor
示例代码时间:NSURL * URL = [NSURL URLWithString:@“ITMS服务://行动=下载舱单及URL = https://开头.. ... plist“]; [[UIApplication sharedApplication] openURL:url选项:@ {} completionHandler:nil]; – Dvor