Apple’s iOS implements a custom URL scheme is a mechanism through which third-party apps can communicate with each other. This allows your app to launch other apps.
Using this powerful iOS feature is simple, just provide the app’s url to the Titanium.Platform.openURL method.
List of Custom Url Schemes Resources
The most challenging part of using Custom Url Schemes is finding available url’s to call. Several new services have been released to meet this need. Below is a few of the most comprehensive resources I have found. Unfortunately many of the examples only show the top level Url without detailed functionality mapping.
- Akosma iPhone URL Schemes – A large list of Apple and 3rd party app Urls
- handleOpenUrl – Large collection of custom schemes many with examples
- App Lookup – Lists many top level App scheme names
- Zwapp – 1 million top level App scheme names
Custom Url Examples:
Using the Custom Url Scheme resources discussed above you can quickly integrate with a wide variety of services using the same implementation pattern as shown below. The below are a few examples showing how you can use custom urls within your Titanium app.
FaceTime:
//Make a facetime call var url = "facetime://1234567890"; if (Titanium.Platform.canOpenURL(url)) { Titanium.Platform.openURL(url); } else { alert('Cannot open app'); }
iBooks:
//Open an iBook from the App Store var url = "itms-books://itunes.apple.com/us/book/the-zombie-survival-guide/id419952002"; if (Titanium.Platform.canOpenURL(url)) { Titanium.Platform.openURL(url); } else { alert('Cannot open app'); }
Facebook:
//Open the facebook app to the friends section var url = "fb://friends"; if (Titanium.Platform.canOpenURL(url)) { Titanium.Platform.openURL(url); } else { alert('Cannot open app'); }