开发者

more than one app has same URL Identifier for Custom URL Application?

开发者 https://www.devze.com 2023-02-06 03:50 出处:网络
i have used custom URL scheme in my Application to open it fr开发者_如何学运维om another Application(which may be my Own).suppose more than one Application in App store may have The URL Identifier i u

i have used custom URL scheme in my Application to open it fr开发者_如何学运维om another Application(which may be my Own).suppose more than one Application in App store may have The URL Identifier i used.if user has two Application with same URL Scheme, what will open? will Custom URL Application be approved by apple?


Custom URL apps are accepted by Apple. However if multiple apps on the device have registered same URL scheme then the behavior is undefined. From iOS Application Programming Guide, "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."


Short answer: First app to register URL will sometimes open but it will fail to open often. Other times second app to register will open but fail often. Basically it fails a lot and really is "undefined". Use http://handleopenurl.com/ to avoid.

Long Answer:

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

I loaded FirstApp and the URL worked as expected, opening the app.

I then loaded SecondApp and the dreaded undefined behavior started occurring. Currently, under iOS 7, if two apps have the same custom URL registered it pops up a modal asking

Open this page in "Name of First App"?

When you tap the Open option it fails, and nothing happens. If you tap or enter the link again the first app installed with that URL, in our case FirstApp, will launch.

So in effect, the second app to register never gets opened, and the first app fails every two URL calls. No ideal behavior.

What makes it even worse is I deleted both apps and then switched the order I installed them and the results are not consistent. Sometimes it is one app, then on reloading both apps it is the other. The behavior really is "undefined".

Best practice is to use http://handleopenurl.com/ to see what URLs have been registered and chose one that will not conflict with other apps. You can't "steal" another URL because you can't be sure your app will open and not the other app.


this may be your answer that you are finding

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

By reading this article It may be possible that apple can reject your application, still you can read the guide line provided by apple. Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号