How to check if Apple Maps is installed

后端 未结 2 1319
天涯浪人
天涯浪人 2021-01-04 01:27

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. Whil

相关标签:
2条回答
  • 2021-01-04 02:00

    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.

    0 讨论(0)
  • 2021-01-04 02:13

    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:

    0 讨论(0)
提交回复
热议问题