【发布时间】:2020-04-07 07:31:53
【问题描述】:
我尝试从我的应用中打开优步应用。它直接将我重定向到应用商店,而不是应用。我希望它直接打开优步应用程序,而不是通过应用商店应用程序。这是我的功能:
func callUrl(){
if let url = NSURL(string: "Uber://"), UIApplication.shared.canOpenURL(url as URL) {
UIApplication.shared.open(url as URL)
} else if let itunesUrl = NSURL(string: "https://apps.apple.com/us/app/uber/id368677368"), UIApplication.shared.canOpenURL(itunesUrl as URL) {
UIApplication.shared.open(itunesUrl as URL)
}
}
【问题讨论】:
-
您是否在 info.plist 中将
Uber添加到您的LSApplicationQueriesStrings中? -
你确定需要添加它吗?
标签: ios swift xcode nsurlconnection func