iTunes, App Store and YouTube on iOS clearly register http://... URL schemes to open their apps.
Can anyone do that, not just your own protocol?
The reason I want to do this is that I am working on an app for a festival. I want to "intercept" links to specific pages on the website and launch the app instead, if installed.
So far I have no had much luck
First, you have to download the IPA file for the app, which requires macOS and Apple Configurator 2. When you finally find the IPA, you have to turn it into a ZIP file, show the contents of the app package, then hunt for the specific PLIST file that contains the scheme names.
URL schema is used as an identifier in launching applications and performing a set of commands in iOS devices. The schema name of a URL is the first part of a URL. (e.g. schemaname:// ). For web pages, the schemas are usually http or https.
The way you can do this for "http://" URLs (and what I think Apple and Spotify do) this is to:
Register a custom URL scheme like the other answers have shown.
Set up your HTTP URL to point to a real webpage.
Put a script on that page to redirect to your custom URL if is on iOS.
For example, here is a sample page which will take you to the Twitter app for a particular user or the Twitter website depending upon if you are on the web or on your iOS device:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Twitter</title> </head> <body> <script type="text/javascript"> var username = document.location.search.substr(1); document.location.replace( "standalone" in window.navigator ? 'twitter:@'+username : // iOS 'http://twitter.com/'+username); // others </script> </body> </html>
Try it out here: http://bl.ocks.org/d/3153819/?mckamey
iOS 9 supports Universal Links, which allows iOS to launch an app based on a standard http://
URL (based on the hostname) without the user having to go through Safari.
It requires some web server configuration (you need a website), but once setup, the registered app will open the link instead of Safari.
For the users that don't have iOS 9, you can use Smart Banners to ease the experience.
Unfortunately I don't think you can do that. You can register your own custom scheme e.g yourFestival:// and pass data from the outside world (SMS , email , other apps) to your app.
I wrote a blog post about this here : Using custom schemes and passing data between iOS apps.
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With