Is there any way to check if user has a certain app (google.maps, yandex.maps or native maps) on his/her device to make a list of apps suitable for routing?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can check if user has this apps on device (google.maps, yandex.maps or native maps) using URL scheme.
for Google maps:
let appURL = URL(string: “comgooglemaps://”)
if UIApplication.shared.canOpenURL(appURL!) {
// code for open URL
print(“Can Open URL”)
}