URL identifier and URL scheme

有些话、适合烂在心里 提交于 2019-11-27 11:33:56

问题


In iOS you can set up URL scheme so other apps can launch you or pass data to you. What's the URL Identifier for? It doesn't seem to be used anywhere other than when you specify URL Schemes.

Also, what happen when there is duplicate URL schemes on the phone?


回答1:


According to Apple documentation they don't give much info about the identifier and why it is needed or where it is used. They only say that it should be unique:

A string containing the abstract name of the URL scheme. To ensure uniqueness, it is recommended that you specify a reverse-DNS style of identifier, for example, com.acme.myscheme. The string you specify is also used as a key in your app’s InfoPlist.strings file. The value of the key is the human-readable scheme name.

Also if more than one app specify the same url scheme, then the outcome is unpredictable:

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 experience taught me that the app who first registered that scheme will be opened, but this may be wrong.



来源:https://stackoverflow.com/questions/16597631/url-identifier-and-url-scheme

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!