Provide means to exclude paths from Universal Links (applinks) JSON manifest

Originator:james.reggio
Number:rdar://23110014 Date Originated:10/14/2015
Status:Fixed/Duplicate Resolved:Fixed in iOS 9.2 / Duplicate of 21938110
Product:iOS SDK Product Version:iOS 9
Classification:Enhancement Reproducible:Always
 
[Want to discuss? Get in touch with me @jamesreggio.]

Universal Links have provided a significant improvement to cross-app navigation in iOS 9; however, I encountered one significant pain-point during implementation: it is not possible to remove paths from the `applinks.details.paths` array within the `apple-app-site-association` JSON manifest.

The system permits the use of wildcards, which is convenient for apps that wish to map most URLs into the app; however, the inability to subtract/exclude a path after the wildcard is applied makes this quite difficult for certain URL structures.

I've included an example in the 'Steps to Reproduce' section. My recommendation would be to:

1) Make the ordering of the `paths` array significant.
2) Introduce an prefix operator (ideally `!`) to exclude paths from the manifest.

For inspiration, the `gitignore` pattern format is a good place to start. (The path format in a `gitignore` file is quite simple, and I've never found it impossible to express my needs.) https://git-scm.com/docs/gitignore

Another good example would be the `minimatch` library, though this is less compatible with your existing specification (due to the `**` glob operator). I suggest this because the choice of JSON implies an affinity for JavaScript technologies, of which `minimatch` is the canon for path matching. https://github.com/isaacs/minimatch

Finally, may I kindly recommend that you improve the documentation around the existing wildcard facilities, particularly as they concern leading and trailing slashes. It's not clear whether a leading slash is required (or what happens if it's not and it's omitted), and it's not clear whether an `*` wildcard will match only one or more than one path part.

Steps to Reproduce:
Imagine a website like Twitter, where a user's handle is specified as the first part of a path and there are nested sub-resources under the user's handle. For example:

https://twitter.com/jamesreggio
https://twitter.com/jamesreggio/status/123456

I would like for all of these URLs to launch the Twitter app, but there are a couple of URLs that *should not* load the Twitter app—the OAuth login flow, for instance, which lives at:

https://twitter.com/oauth/new

Now, if I set the `paths` array to the following, I'll capture all of the URLs on the domain, including the `/oauth/new` path:

['/*']

There is no way to include all user profiles, but exclude the `/oauth/new` path.

The ideal facility would allow me to begin with the wildcard, and then subtract paths that should not load the app. For instance:

[
  '*',
  '!/oauth/*'
]

Version:
iOS 9

Configuration:
iPhone

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!