user142019
user142019

Reputation:

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.

Upvotes: 1

Views: 1012

Answers (3)

Hitesh Vaghela
Hitesh Vaghela

Reputation: 1635

NSString *rootAppPath = @"/Applications";

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

NSLog(@"%@",listApp);

Upvotes: 0

Julio Gorgé
Julio Gorgé

Reputation: 10106

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.

Upvotes: 3

nevan king
nevan king

Reputation: 113777

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

Upvotes: 1

Related Questions