Multiple apps with the same URL Scheme - iOS

江枫思渺然 提交于 2019-11-28 17:47:23
rmaddy

If two apps register the same custom URL scheme, it is undefined which app will actually be launched. One will be launched but there is no way to know.

Here's a real kicker. If you have two apps on your device with the same URL scheme, and you delete the one that actually gets launched, the other one will not get launched by the URL without rebooting the iOS device.

Your best solution is to ensure your custom URL scheme is not trivial so there is little chance another app will have the same scheme.

Updated for 2016

Apple's policy has changed since 2012. Today they indicate that multiple apps will not be allowed to register for the same scheme. Registration time is a much cleaner place to address contention than runtime, since it avoids the security issues discussed it other answers.

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.

Source:https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW1

Dustin

From de Apple docs:

Implementing Custom URL Schemes

I don't have an answer for the rest of your question (at this time at least).

EDIT:

According to the apple docs:

Note: If multiple third-party applications register to handle the same URL scheme, it is undefined as to which of the applications is picked to handle URLs of that type.

(Oh sorry rmaddy, didn't see your answer till after :P)

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