如何获取您的iPhone应用程序列表 [英] How to get a list of your iphone apps

查看:126
本文介绍了如何获取您的iPhone应用程序列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何获得所有iphone应用程序的列表(甚至每个应用程序的指针都会有帮助)?

How can i get a list of all my iphone apps (even pointers for each app will be helpful)?

我正在开发一个包含一些屏幕的应用程序应该有我所有已安装应用程序的列表(带有他们的图标),以及选择一个将来启动它的选项取决于我的其他功能。

I'm developing an app which contain some screen that should have a list of all my installed apps (with their icon) and the option to select one to launch it in the future depends in other function of mine.

谢谢很多!

推荐答案

没有办法实现这一点,因为每个应用都是沙盒。

There's no way to accomplish this, because each app is sandboxed.

如果他们有自定义URL方案,您将能够确定是否安装了选定的应用程序。例如,Facebook应用程序可以使用自定义URL方案fb://启动,但这些不保证是唯一的,因此不同的应用程序可以使用众所周知属于另一个应用程序的方案。此外,并非所有应用程序都有自定义URL方案,您需要一些主列表(需要不断更新才能准确)以检查每个应用程序是否存在。因此,您可以使用自定义URL方案检测已知应用程序的选择列表,但永远不会获得所有这些应用程序列表。

You would be able to determine if select apps are installed if they have custom URL schemes. For example, the Facebook app can be launched with the custom url scheme "fb://", but these aren't guaranteed to be unique, so a different app could use a scheme that's well known to belong to another app. Also not all apps have a custom URL scheme, and you would need some master list (that would need to be constantly updated to be accurate) to check for the presence of each. So you could maybe detect a select list of well-known apps with custom URL schemes, but never get a list of all of them.

如果您只想检测到自己的应用程序,您可以拥有自定义URL方案几乎肯定会为每个应用程序设置唯一,并检查这些。

If you just wanted to detect your own apps, you could have custom URL schemes that are almost certainly going to be unique set for each app, and check for those.

您也可以越狱您的设备,但我假设您希望在应用商店中分发的应用中使用此功能,因此您将无法添加需要越狱的功能。

You could also jailbreak your device, but I'm assuming you want this functionality in an app that is distributed on the app store, so you wouldn't be able to add functionality that requires a jailbreak to work.

编辑:

以下是检测正在安装的Facebook应用程序的示例:

Here's an example showing detection of the Facebook app being installed:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]])
{
    // Handle the Facebook app being installed
}

但请注意,这不会为您提供有关该应用的任何信息。任何应用开发者都可以将fb://自定义网址方案添加到他们的应用中,这会使其错误地检测到它。

Note however, this won't give you any information about the app. Any app developer could add the "fb://" custom url scheme to their app, which would make this falsely detect it.

如果要查找自定义列表iOS应用的网址方案,只需在Google上搜索。

If you want to find lists of custom url schemes for iOS apps, just search in Google.

这篇关于如何获取您的iPhone应用程序列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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