Anyone aware how to check whether Apple Maps is installed or not? I could not find anything in the docs.
With iOS10 users can delete the Apple Maps application. While for Google Maps we can use UIApplication.shared.canOpenURL()
to check if it's installed. I am not aware of such a thing exists to check for Apple Maps.
Of course one can check if opening a MKMapItem
with mapItem.openInMaps()
fails - but that does not help for checking in advance.
How to Get Maps App Back on iPhone. Open the App Store. Search for Maps Apple. Find the Maps app; it's likely at the top.
Open Apple Maps There are a couple of ways to open the app: Simply tap on the app icon wherever it resides on your homescreen. Tap “Apple Maps” from your today view by swiping right from your homescreen. Click an address from a website, text message, or email, and Apple should automatically open Maps to that location.
You can create and share your own maps online with My Maps. My Maps isn't available for iPhone or iPad, but you can view your My Maps using Google Maps on your computer.
Apple Maps remains the only default map app on iPhones, even in iOS 15.2. It's up to Apple whether or not the company will relent and allow users to change the preferred option without jailbreaking.
The simple answer is this is not currently possible.
The reason is that Apple Maps application is not deleted, only application icon is removed from home screen (see Mike D comment).
Custom url of this app (maps://
) is still registered, so sharedApplication can open this url. But when you try to open this url and app icon is removed from home screen, user is notified about restoring the application through AppStore. When user wants to restore app, it is restored immediately (nothing is downloaded).
Result of MKMapItem.openMaps
means only user decision if he wants to open Apple Maps.
IMHO Apple Maps cannot be regularly uninstalled because their data are being reused by other applications.
In the current version i.e. 11.2, it appears you are able to remove Apple Maps from your phone. But unfortunately, if you do something like:
if (UIApplication.shared.canOpenURL(URL(string: "maps://")!)) {
//do whatever you need to do here.
}
it still returns true
.
But it does handle navigation gracefully anyway. In my case I am providing the user a chooser between Apple Maps and Google Maps. When Apple Maps is not present it provides me with this, IMHO, this is fine because the user is not navigated away from the app and can choose a different option if they want to:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With