开发者

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

开发者 https://www.devze.com 2023-02-08 10:29 出处:网络
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 wi开发者_StackOverflowthout private symbols and without a jailbreak?

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 wi开发者_StackOverflowthout 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);
0

精彩评论

暂无评论...
验证码 换一张
取 消