Do more than one application have the same URL identifier for a custom URL application?

I used my own URL scheme in my application to open it from another application (which may be my own). Several apps in the app store may have a URL identifier i. If a user has two applications with the same URL Schema, what will open? will the custom url app be approved by apple?

+8
iphone ios4 ipad
source share
3 answers

Custom URLs are accepted by Apple. However, if several applications on the device have registered the same URL scheme, the behavior is undefined. From iOS Application Programming Guide : "If several third-party applications are registered to process the same URL scheme, then it is undefined which application is selected to process this type of URL."

+15
source share

Short answer: the first application for registering a URL sometimes opens, but it often does not open. In other cases, the second application for registration will be open, but not often. Basically, it is not so much, and in fact it is "undefined". Use http://handleopenurl.com/ to avoid this.

Long answer:

I created two applications, FirstApp and SecondApp, and registered the same testURL URL for both.

I downloaded FirstApp and the URL worked as expected by opening the application.

Then I downloaded SecondApp and the scary undefined behavior started. Currently in iOS 7, if two applications have the same user url, it will issue a modal request

Open this page in the "Name of the first application"?

When you click the Open option, it fails and nothing happens. If you touch or enter the link again, the first application installed with this URL, in our case, FirstApp will start.

Thus, the second application for registration never opens, and the first application fails every two calls to the URL. There is no perfect behavior.

To make matters worse, I uninstalled both applications and then switched the order that I installed and the results are incompatible. Sometimes this is one application, then when you restart both applications it is another. The behavior is really "undefined".

Best practice is to use http://handleopenurl.com/ to find out which URLs are registered and choose the one that will not conflict with other applications. You cannot β€œsteal” another URL because you cannot be sure that your application will open, and not another application.

+10
source share

It may be your answer that you find

http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html

After reading this article, Apple may possibly reject your application, but you can read the manual provided by the apple. Thanks

-one
source share

Source: https://habr.com/ru/post/651344/


All Articles