3

Using iOS14.5,

My URL looks like this: https://www.myexample.com/invitation?invitationCode=123456

Inside my apple-app-site-association file, which components is correct ?

(Please notice the tiny difference of /invitation vs. /invitation* vs. /invitation/ vs. /invitation/* inside the component)

A) ?

"components": [
    {   "/": "/invitation",
        "?": { "invitationCode": "??????" }
    }
]

or B) ?

"components": [
    {   "/": "/invitation*",
        "?": { "invitationCode": "??????" }
    }
]

or C) ?

"components": [
    {   "/": "/invitation/",
        "?": { "invitationCode": "??????" }
    }
]

or D) ?

"components": [
    {   "/": "/invitation/*",
        "?": { "invitationCode": "??????" }
    }
]

Or is it even something else ?

iKK
  • 6,394
  • 10
  • 58
  • 131
  • Which one works correctly? – matt May 06 '21 at 19:06
  • don't know yet - I am not the master of the hosting service and therefore I would like to program it correctly before I send it to my colleagues. And unfortunately, Apple makes quite a big chaos explaining poorly and making changes from OS to OS so that I am asking an expert here that did it 100 times before... – iKK May 06 '21 at 19:08
  • That is not a viable development procedure. You need to test on your own server first. SO is not an excuse for programmers not to do their work properly. And it seems to me that Apple's docs are quire clear about this. See https://developer.apple.com/documentation/xcode/supporting-associated-domains for example. – matt May 06 '21 at 19:25
  • Moreover you do not need a server in order to test a universal link, since you can throw the universal link directly at the simulator using `simctl` and see what happens. – matt May 06 '21 at 20:01
  • 1
    @matt there is literally no documentation. Not a single definition of keys used, not word about order, evaluation execution. Can i use multiple wildcard operators? Are there more operators besides *? Would an empty string match apex host only? – Ryan Romanchuk Oct 29 '21 at 02:26
  • 1
    it's always been a mess https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1 there are literal radars from 2015 I mean just look https://www.google.com/search?q=applinks+subdomain+wildcard Horrible take, this is exactly what SO is for. Unless you have secret RFC, couldn't think of a worst use of time of "testing through documentation" – Ryan Romanchuk Oct 29 '21 at 02:45

1 Answers1

3

Option D looks okay it means that, "Matches any URL whose path starts with /invitation/ and which has a query item with name 'invitationCode' and a value of exactly 6 characters". If you invitation code always be 6 characters it works otherwise you can remove query parameter value.

For more information you can check the Apple Documentation which is my reference.

Alihan
  • 628
  • 4
  • 10
  • thanks, and why does A not work ? Where can you find the documentation for the closing `/` - especially since my URL does not have the closing `/` ??? Of course, I'll give it a try - hopefully not upsetting my colleagues ;) – iKK May 06 '21 at 19:13
  • I think A means the url only contains invitation path without any parameters. But I'm not 100 percent sure. – Alihan May 06 '21 at 19:21
  • Thank you, I definitively give you all feedback which one it actually is. I send it to my colleagues with option D for now ;) – iKK May 06 '21 at 19:22
  • Okay I'll wait your feedback :) Thank You! – Alihan May 06 '21 at 19:24
  • It is solution D `"/": "/invitation/*"` exactly how you had predicted it. – iKK May 07 '21 at 10:10
  • Perfect, Cheers! – Alihan May 07 '21 at 14:16
  • @iKK what if invitationCode = 123 static value? – Manish May 10 '22 at 11:58