Reputation:
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
Reputation: 1635
NSString *rootAppPath = @"/Applications";
NSArray *listApp = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:rootAppPath error:nil];
NSLog(@"%@",listApp);
Upvotes: 0
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
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