If 2 other app register same url scheme, how iOS handle this?
The URL scheme is an interesting feature provided by the iOS SDK that allows developers to launch system apps and third-party apps through URLs. For example, let's say your app displays a phone number, and you want to make a call whenever a user taps that number.
Register your URL schemeRegister your scheme in Xcode from the Info tab of your project settings. Update the URL Types section to declare all of the URL schemes your app supports, as shown in the following illustration. In the URL Schemes box, specify the prefix you use for your URLs.
Finding an App's Main URL Scheme Name 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.
The iOS Documentation reads:
Note: If more than one third-party app registers to handle the same URL scheme, there is currently no process for determining which app will be given that scheme.
The OSs behaviour is undefined if there are two apps registered for an URL scheme, therefore you should try to define a handler that is specific for your app to avoid this situation (e.g. awesomeMapsApp://
instead of maps://
).
Actually it can be really problematic. For example, til' March 2016, an app called Grabb
handles PayPal
schemes so that if your app tries to open PayPal
(with all the security nonce etc. within the call) it launches Grabb
instead, and you can do nothing about it. Even with the openURL alertView
added in iOS 9, it can still be a big security issue.
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