简体   繁体   中英

Is there a legal way of obtaining all installed apps on an iOS device from within my app?

I am making an app that needs to check if certain apps are installed with a given identifier.

Is there a way to do this without private symbols and without a jailbreak?

Thanks.

Bump developer gives a hint of how they do it on their blog (see comment at the bottom):

Q: […] How do you check wich applications the end-user have installed? I thought that apple didn't aprove apps that do that..

A: […] There's not a simple way to detect which apps are installed. We use a combination of several methods. If the other app you need to detect has a custom URL registered, you can check to see if that URL exists. Otherwise, you can look for that app's process name running in the background.

This will work for some of the apps, but not all. If the app has a custom URL scheme, you can query the application object to see if it responds:

Here's how to check for AirSharing:

NSString *stringURL = @"airsharing://";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

From this page: http://wiki.akosma.com/IPhone_URL_Schemes

NSString *rootAppPath = @"/Applications";

NSArray *listApp = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:rootAppPath error:nil];

NSLog(@"%@",listApp);

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