Detecting whether another iOS app is installed
In order to work with other apps, they must support a URL scheme. In its simplest form, this will allow you to detect and launch the app. More preferable is if the app supports URL scheme commands, allowing you to send instructions or data to it. There are a plenty of resources out there for doing this, including http://handleopenurl.com. On this site, you can look up particular apps and find out whether they support URL schemes.
As a general rule of thumb, most modern-day iOS apps support URL schemes by default, allowing you to launch them either with the app name (appname://
) or by their full bundle identifier (com.mycompany.appname://
).
In this recipe, we're going to use a very simple bit of code to detect whether another app is installed using the URL scheme. Ideally, you would want to do this on a device, but you can test it with the stock simulator apps along with your own apps.
Getting ready
To prepare for this recipe, open Appcelerator...