我不知道如何检查手机上是否安装了应用程序!或安装应用程序时,打开应用程序,否则打开应用程序商店链接下载应用程序。我正在使用 swift 3。我想使用app name 或bundle identifier 来完成。 谢谢!
最佳答案
func openApp(appName:String) {
let appName = "instagram"
let appScheme = "\(appName)://app"
let appUrl = URL(string: appScheme)
if UIApplication.shared.canOpenURL(appUrl! as URL) {
UIApplication.shared.open(appUrl!)
} else {
print("App not installed")
}
}
关于ios - 怎么查看手机有没有安装app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41545283/