问题
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”)
}
来源:https://stackoverflow.com/questions/53852623/how-to-get-the-list-of-applications-suitable-for-routing-from-the-user-s-device