6

I implemented Universal Links. The apple-app-site-association is structured as follows:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "APPID.my.awesome.newspaper",
                "paths": [ "NOT /webapp/issue/*/ads/*", "/webapp/issue/*/*.html" ]
            }
        ]
    }
}

For some reason the first path with the NOT is not considered at all.

For example:

These URL's are handled as expected:

awesome-newspaper.my/webapp/issue/sz/2016-01-22/page_2.157908/article_1.2828646/article.html  
awesome-newspaper.my/webapp/issue/sz/2016-01-22/page_2.157908/page.html

This URL should not be handled as Universal Link and should always open in Safari.

awesome-newspaper.my/webapp/issue/sz/2016-01-22/ads/ad_145/index.html  

But it always opens in the App as well.

Can someone please help me out?

pstued
  • 371
  • 1
  • 9
  • Please check this link http://stackoverflow.com/questions/32751225/ios9-universal-links-does-not-work?rq=1. Maybe it will help you. – Alexander Khitev Jan 27 '16 at 13:21
  • Does this link 'awesome-newspaper.my/webapp/issue/sz/2016-01-22/ads/ad_145/index.html ' is accessible HTTPS web server? – Aruna Mudnoor Feb 03 '16 at 05:16
  • Did you find any solution to this? – Tejas K Mar 17 '21 at 08:26
  • @TejasK we did find a way to make it work but I unfortunately barley remember the steps we took. I should have posted the solution afterwards on my question, sorry for that. However when I recall correctly, iOS will fetch the `apple-app-site-association` only on certain occasions like a fresh install of the application. Did you already try a clean install after changing the `apple-app-site-association` file to ensure iOS has the lastest information? – pstued Mar 17 '21 at 14:55

1 Answers1

0

i think the problem is that your URL matches both cases, which is then making the results unpredictable.

try making the paths mutually exclusive. if thats not possible you may need to change the URL structure.

UPDATE:

it's possible that your NOT string is ill formatted, try changing it to: "NOT /webapp/issue/*/ads/*/*.html"

Casey
  • 6,531
  • 24
  • 43
  • 1
    Regarding to Apple's documentation it stops checking the paths after a match. [Universal Link](https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html): Because the system evaluates each path in the paths array in the order it is specified—and stops evaluating when a positive or negative match is found—you should specify high priority paths before low priority paths. Note that only the path component of the URL is used for comparison. Other components, such as the query string or fragment identifier, are ignored. – pstued Jan 29 '16 at 15:38