Bump (and others) recently pushed out an update for their iPhone app which allows users to detect their installed apps, and then share recommendations. As with the rest of the application, this new feature is awesome; if not because it will yet again save people time, then because it can detect what apps you have installed.
Many people have noted that this seems a little bit beyond what Apple would allow an app to know. Bump did, however, somewhat describe what they do behind the scenes. In this post, I’ll be describing how this functionality works, why it is awesome and important, and how regular iOS developers (little ones like me) can implement it themselves or use my new API: iHasApp.
So how does it work?
Now, Apple doesn’t actually let developers do this through a native API — every service that generates a list of your installed apps has to find a workaround...while [Lieb] wouldn’t get into details on how it works, he says it involves looking at the list of applications that are currently running on the phone. The only catch: apps that you don’t run frequently won’t show up.
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.
A bit of research shows that there are four [1,2,3,4] methods for searching through a user’s apps. The last two are Private API/Jailbreak only, and conveniently the first two are specifically mentioned by Bump: checking if a specific URL scheme is supported by the device (and thus the app is installed), and comparing the devices currently running processes to known app executable names. Specifically, these two functions are canOpenUrl: and sysctl().
Without going into technical details, if a developer has a list of iOS apps consisting of the app IDs, the executable’s name, and the supported URL scheme (if any), then that developer can check with relative accuracy what apps are installed. Note that this is different from being provided with information regarding installed apps, as the developer must already know more information than is provided. The accuracy is only as good as the size and quality of the database of information.
Why is this awesome?
Automatic personalization is built into almost everything these days: the music being fed from Pandora, the advertisements in webpages, etc. Aside from Facebook integration and small questionnaires, not many iPhone apps adjust automatically to the user’s specific tastes. Developers have been leveraging user’s location information and iPod library to create localized and personalized experiences right from the first launch. Imagine if developers knew whether or not you play games, read the news?
Do it yourself with iHasApp
I made the iHasApp framework as a part of an iPhone app recommendation engine I have been working on, and looked around at the equivalent functionality of Bump, Frenzapp, and Appsfire. All three apps had different amounts of results (Bump had the most), some false positives, as well as different speeds. I liked the functionality in all of them, and would like it in more apps. So here it is: my own API backed by my own database. Those of you who want the technicals, read on there.