简体   繁体   中英

How to get a list of your iphone apps

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.

Thanks alot!

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

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.

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.

EDIT:

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
}

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.

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

another way to look at this is to present the user with all of your app in the appstore. If they have any apps installed on their device then in iOS 7 they will see a button called "Open" next to each of them.

For example you can have a UITableViewCell or a UIButton that says "Checkout Our Apps". In the code you would add this.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms://itunes.com/apps/sixaxisllc"]];

Replace SixAxis LLC with your iTunes developer name and when users click on it, it will launch AppStore app with only your apps are shown. (With Open or price amount next to each of them)

NOTE: test this on actual device and not in simulator

在此处输入图片说明

Because of the Sandboxed environment, all you can do is test if it you can open a custom URL. Akosma Software maintains a list of popular Url on his wiki: IPhone URL Schemes .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM