According to this iphonedevsdk.com forum post, Frenzapp uses two methods to detect other apps installed on an iOS device:
- UIApplication canOpenUrl: to check if known custom URL schemas can be opened
- A "kernel level C function", that is "authorized by apple".
What "kernel le开发者_运维百科vel C function" are they using? Where is it documented?
Thanks to Vladamir and Stephen Darlington for commenting and pointing us at what is most likely the answer:
- The kernel C function is sysctl()
- It's documented on Apple's iOS Developer site
- You need to call it with a certain set of arguments to get the list of running processes (ids and strings)
- See Vladimir's previous answer or This post for example code
Right, though the process list is both very limited and presupposes that the process is indeed "running" in the background.
The key for discovery is having a large enough inventory of both process names (but the background tasking can only go so far...) and URLhandlers. And only a few companies in the World (if that many) outside of Apple can actually do this well.
And of course, the Springboard has an open-socket protocol that lets the App Store app (and potentially other apps) query whether an app is installed or not... but that's actually a much tougher one to crack.
精彩评论