确定应用程序是否存在并在 iOS 上启动该应用程序 [英] Determine if an app exists and launch that app on iOS

查看:25
本文介绍了确定应用程序是否存在并在 iOS 上启动该应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法检查 iOS 以查看是否已安装并启动另一个应用程序?如果没记错的话,这在早期版本中是不可能的,但是这已经改变了吗?

Is there a way to check iOS to see if another app has been installed and then launched? If memory serves me this was not possible in early versions but has this been changed?

推荐答案

可行,但很棘手.

使用自定义 URL 方案启动已安装的应用程序,如 FB 或 Twitter 应用程序.这些既可以在其他应用程序中使用,也可以在网站上使用.

Launching installed apps, like the FB or Twitter apps, is done using the Custom URL Scheme. These can be used both in other apps as well as on web sites.

这是一篇关于如何使用您自己的应用程序来做到这一点.

但是,查看 URL 是否存在可能会很棘手.Boxcar 是检测已安装应用的一个很好的应用示例.这里的问题是 Boxcar 对自定义 URL 有深入的了解.我相当 (99%) 确定有一个 canOpenURL:,因此提前了解您想要定位的应用程序的自定义方案可以让这很容易实现.

Seeing if the URL is there, though, can be tricky. A good example of an app that detects installed apps is Boxcar. The thing here is that Boxcar has advanced knowledge of the custom URL's. I'm fairly (99%) certain that there is a canOpenURL:, so knowing the custom scheme of the app you want to target ahead of time makes this simple to implement.

这里是部分列表 一些您可以检查的更流行的 URL.

Here's a partial list of some of the more popular URL's you can check against.

有一种方法可以找到自定义应用的 URL:https://www.amerhukic.com/finding-the-custom-url-scheme-of-an-ios-app

There is a way to find out the custom app URL : https://www.amerhukic.com/finding-the-custom-url-scheme-of-an-ios-app

但如果你想扫描应用程序并推断其 URL,则无法在非 JB 设备上完成.

But if you want to scan for apps and deduce their URL's, it can't be done on a non-JB device.

这是一篇博文,讨论 Bump 的人们如何处理问题.

Here's a blog post talking about how the folks at Bump handled the problem.

这篇关于确定应用程序是否存在并在 iOS 上启动该应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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