ios – Complicated queries in common hyperlinks: AND vs. OR within the AASA (apple-app-site-association) file

0
1
ios – Complicated queries in common hyperlinks: AND vs. OR within the AASA (apple-app-site-association) file


Within the app I am engaged on I need common hyperlinks with fairly a number of totally different potential question phrases (eight to be particular). And any mixture of these eight question phrases can be utilized.

For instance, the next are all legitimate:

https://instance.com/path/?term1=foo

https://instance.com/path/?term1=foo&term2=bar

https://instance.com/path/?term1=foo&term2=bar&term3=baz

It has been a little bit of a battle, however my conclusion is that the AASA file, in case you use question keys (“?”) within the parts dictionaries solely successfully permits “AND” circumstances inside a selected parts dictionary. To attain an “OR” it’s a must to give a number of parts dictionary entries. So, for instance, the next parts dictionary is an implicit “AND” situation indicating that every of the question phrases have to be provided:

{
    "/": "/path/*",
    "?": {
        "term1": "?*",
        "term2": "?*",
        "term3": "?*"
    }
}

So, the next hyperlink:

https://instance.com/path/?term1=foo&term2=bar&term3=baz

would match, however these different wouldn’t match:

https://instance.com/path/?term1=foo

https://instance.com/path/?term1=foo&term2=bar

And the next parts dictionaries collectively enable only a single of the question phrases for use (successfully an “OR” situation):

{
    "/": "/path/*",
    "?": {
        "term1": "?*",
    }
},
{
    "/": "/path/*",
    "?": {
        "term2": "?*"
    }
},
{
    "/": "/path/*",
    "?": {
        "term2": "?*",
    }
}

So, for instance the next would match:

https://instance.com/path/?term1=foo

However this one wouldn’t match:

https://instance.com/path/?term1=foo&term2=bar

If I’ve eight question phrases, and want to permit all potential combos of these phrases, and need to use the question format in an AASA file I might have to present 2^8 combos (parts dictionaries) within the AASA file.

Alternatively, in fact, I may simply use a parts entry of:

{ “/”: “/path/*" }

and in my app limit the potential question phrases.

I’ve discovered no definitive Apple documentation on this. However, the next is suggestive

From WWDC 2019 Session 717 “What’s New in Common Hyperlinks”:

“For a parts dictionary to match a candidate URL, all of the
specified parts should match”

This implies that a number of question parameters in a parts
dictionary use AND logic.

Supply: WWDC 2019 Session 717 – What’s New in Common
Hyperlinks
.

I am penning this as an SO query to see if others produce other data which may assist this or that might disconfirm this.

LEAVE A REPLY

Please enter your comment!
Please enter your name here