我试图打开一个已安装在手机上的应用程序,但需要一个网址才能打开它。这是我使用的功能:
func openAppFromMenu(inAppURL: URL?, appStoreURL: URL?) {
if inAppURL != nil {
if UIApplication.shared.canOpenURL(inAppURL!)
{
UIApplication.shared.openURL(inAppURL!)
} else {
//redirect to safari because the user doesn't have in app
print("App not installed")
if UIApplication.shared.canOpenURL(appStoreURL! as URL) {
UIApplication.shared.openURL(appStoreURL!)
}
}
} else {
//redirect to safari because the user doesn't in app
print("App not installed")
if UIApplication.shared.canOpenURL(appStoreURL! as URL) {
UIApplication.shared.openURL(appStoreURL!)
}
}
}
如何找到该应用的应用内和应用商店网址?