Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in apple app site association file, why "NOT" doesn't exclude path mentioned?

I have added universal links into my iOS application

messages http://somesite.com/message/list/ >> opens the app to messages 
review   http://somesite.com/review/add/   >> opens the app to review 
place    http://somesite.com/place/add/    >> opens the app to place 
photo    http://somesite.com/photo/add/    >> opens the app to photo

all working as expected, my question is : how to exclude paths or urls, in a way that it never even opens the app?

for example

somepage   http://somesite.com/somepagelink   >> SHOULDN'T OPEN APP, it must show up in the browser.

the apple app site association file

{
    "applinks": 
    {
        "details": [
        {
            "paths": ["*", "NOT /somepagelink/*"],
            "appID": "ID1.myApp"
        }, 
        {
            "paths": ["*", "NOT /somepagelink/*"],
            "appID": "ID2.myApp"
        }],
        "apps": []
    },
    "activitycontinuation": 
    {
        "apps": ["ID1.myApp","ID2.myApp"]
    }
}

is this the correct way to exclude a path?

"NOT /somepagelink/*"
like image 524
DeyaEldeen Avatar asked Apr 25 '17 10:04

DeyaEldeen


People also ask

Where does Apple-App-site-Association file go?

After you create the apple-app-site-association file, upload it to the root of your HTTPS web server or to the . well-known subdirectory. The file needs to be accessible via HTTPS—without any redirects—at https://<domain>/apple-app-site-association or https://<domain>/.well-known/apple-app-site-association .

Does Apple-App-site-Association need to be signed?

As of iOS 9 developer seed 2, you no longer need to sign the apple-app-site-association file for Universal links.

How do I add an Apple App association to a website?

To add the associated domain file to your website, create a file named apple-app-site-association (without an extension). Update the JSON code in the file for the services you support on the domain. For universal links, be sure to list the app identifiers for your domain in the applinks service.

How do I enable associated domains on my app identifier?

Log into your Apple developer account and go to the app's ID page. Enable the Associated Domains app service. Take note of your Prefix (bundle ID) and your ID (team ID) - you will need them later. Add the "Associated Domain" capability to your app in Xcode, and add your web servers' domain as an associated domain.


1 Answers

Yes, your syntax is correct but:

The Apple documentation states, that the order of the statement is important.

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.

The first statement it evaluates in your file is the star "*" which signals "yes, every URL is allowed". Then it will end and open the app.

So maybe try it the other way round?

"paths": ["NOT /somepagelink/*", "*"],

EDIT

IMPORTANT: This is from the comments given below, apart from changes in AASA. You have to reinstall the app for every change to the apple-app-site-association file. It could definitely be a CDN problem if you are using one of those

like image 81
Blackvenom Avatar answered Oct 10 '22 11:10

Blackvenom