iOS Universal links match only query component at root

18 views Asked by At

I'm trying to come up with an AASA file that is going to: Match only URLs that have a query component named "t" at the root of the domain Ignore all other URLs (open in browser)

E.g. example.com/?t=123 - should open in the app example.com/path/?t=123 - should open in the browser example.com - should open in the browser

The closest I got is this:

"components": [
     {
          "/": "/",
          "?": { "t": "*" },
          "comment": ""
     }
]

It covers the first two cases in my example, but this URL example.com opens in the browser. Also, passing any query component opens the app for some reason (e.g. example.com/?aaa=123).

1

There are 1 answers

0
Danylo Kurylo On

By trial and error, I came up with a solution that matches all the needed cases:

"components": [
       {
          "/": "/",
          "?": { "t": "?*" },
          "comment": "Matches any URL with a tag token (t) right after the domain without any additional path. E.g. bubibo.pet/?t=123"
       }
]

I have no idea why the "t" parameter was ignored when using a wildcard, but using an "at least one character" rule did the job. Hope this helps someone