Why do we need "URL Identifier" (CFBundleURLName) plist field to use custom URL scheme on iOS? Why do we need "URL Identifier" (CFBundleURLName) plist field to use custom URL scheme on iOS? ios ios

Why do we need "URL Identifier" (CFBundleURLName) plist field to use custom URL scheme on iOS?


According to apple docs

The identifier you supply with your scheme distinguishes your app from others that declare support for the same scheme.

Although using a reverse DNS string is a best practice, it does not prevent other apps from registering the same scheme and handling the associated links. Use universal links instead of custom URL schemes to define links that are uniquely associated with your website.

So to answer your question adding a url identifier doesn't change much,but its best to include it,as it is specified by apple.


If you have 2 application installed with same URL scheme like:

yourscheme://

then you have 2 conflicting apps.

How will the system decide to open which application launch?

According to the Inter-App Communication documentation

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

Please check this answer for the user who experienced the issue:

Also as far as I've tested and experienced, if you have 2 conflicting apps, it appears to be the first one installed which is used, and when this app is removed the second app which is now the only app supporting the specific URL scheme is still not used

Hope it helps.


The URL Identifier is the reversed domain address which is should be the same as your Bundle Identifier e.g. com.companyname.appname

The URL Schemes is the start of the URL e.g 'appname'. When you call this as a URL it targets the bundle identifier which launches the app.

Reference : URL Identifier and URL Schemes