Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How iOS handle URL scheme duplication?

If 2 other app register same url scheme, how iOS handle this?

like image 899
eonil Avatar asked Feb 24 '11 10:02

eonil


People also ask

What is URI scheme in iOS?

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.

How do I add a custom URL scheme to my iOS app?

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.

Where is the URL scheme of iOS apps?

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.


2 Answers

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://).

like image 183
pre Avatar answered Sep 27 '22 20:09

pre


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.

like image 44
superarts.org Avatar answered Sep 27 '22 20:09

superarts.org