通常我会使用某种公共URL从另一个应用程序中打开一个应用程序,但我得到的只是我打算打开的应用程序的包ID。有没有办法做到这一点?这是我用来在应用程序中打开外部应用程序的功能:
var appStoreURL: URL?
func openAppFromMenu(inAppURL: URL?, appStoreURL: URL?) {
if inAppURL != nil {
if let inApp = inAppURL {
if UIApplication.shared.canOpenURL(inApp)
{
UIApplication.shared.openURL(inApp)
} else {
//redirect to safari because the user doesn't have in app
print("App not installed")
self.appStoreURL = appStoreURL
addAlert()
}
}
} else {
//redirect to safari because the user doesn't in app
print("App not installed")
self.appStoreURL = appStoreURL
addAlert()
}
}
答案 0 :(得分:0)
不,如果应用不在你的应用群组中而且没有公开网址,则无法打开它。