如何检查是否安装了Apple Maps [英] How to check if Apple Maps is installed

查看:117
本文介绍了如何检查是否安装了Apple Maps的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何检查是否安装了Apple Maps吗?我在文档中找不到任何内容.

Anyone aware how to check whether Apple Maps is installed or not? I could not find anything in the docs.

在iOS10中,用户可以删除Apple Maps应用程序.对于Google Maps,我们可以使用UIApplication.shared.canOpenURL()来检查它是否已安装.我不知道要检查Apple Maps是否存在这种情况.

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.

当然可以检查使用mapItem.openInMaps()打开MKMapItem是否失败-但这无助于预先检查.

Of course one can check if opening a MKMapItem with mapItem.openInMaps() fails - but that does not help for checking in advance.

推荐答案

简单的答案是当前无法实现.

The simple answer is this is not currently possible.

原因是未删除Apple Maps应用程序,仅从主屏幕中删除了应用程序图标(请参阅Mike D评论).

The reason is that Apple Maps application is not deleted, only application icon is removed from home screen (see Mike D comment).

此应用程序(maps://)的自定义URL仍被注册,因此sharedApplication可以打开此URL.但是,当您尝试打开此URL并从主屏幕删除应用程序图标时,系统会通知用户有关通过AppStore还原应用程序的信息.当用户想要还原应用程序时,它将立即还原(不下载任何内容).

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

MKMapItem.openMaps的结果仅表示用户要打开Apple Maps的决定.

Result of MKMapItem.openMaps means only user decision if he wants to open Apple Maps.

IMHO Apple Maps无法定期卸载,因为其数据正被其他应用程序重用.

IMHO Apple Maps cannot be regularly uninstalled because their data are being reused by other applications.

这篇关于如何检查是否安装了Apple Maps的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆