Exclude paths from catch-all Universal Links pattern in apple-app-site-association

I'd like to support Universal Links when visiting a user's profile. Like Twitter, Facebook, Github, etc our user URLs are top-level, like https://twitter.com/appstore or https://github.com/bridger.


However, there are other top-level paths that should open on the web and not in our app. They are the equivalent of http://facebook.com/help or https://github.com/settings. They are not user profiles but their URLs are indistinguishable from user URLs.


To support user profile URLs the apple-app-site-association should have a pattern like "/*". That will catch all non-user pages too though. Is there a way of providing a list of enumerating paths that should NOT be handled by Universal Links? Something like ["/settings", "/activity"] etc.


Perhaps I could provide the list of URLs and specify that they should be opened in Safari?

Accepted Reply

This just got added in the iOS 9.2 beta 2 update. If you prefix an entry in the paths array with "NOT " then you can explicitly prevent a match. So in your example you could do something like ["NOT /settings/*", "NOT /activity/*", "/*"] which would prevent paths with /settings or /activity prefixes, and then match everything else.

Replies

This just got added in the iOS 9.2 beta 2 update. If you prefix an entry in the paths array with "NOT " then you can explicitly prevent a match. So in your example you could do something like ["NOT /settings/*", "NOT /activity/*", "/*"] which would prevent paths with /settings or /activity prefixes, and then match everything else.