'iOS universal links (applinks) not working for subdomains

Having an issue filtering allowed subdomains for my app's universal links.

Let's say i have those domains:

 - a.subdomain.domain.com 
 - b.subdomain.domain.com 
 - c.subdomain.domain.com

I want my app to be opened by a.subdomain.domain.com and b.subdomain.domain.com but not c.subdomain.domain.com.

As i understood it's not possible to exclude a subdomain in the association file hosted on the server, only path for that domain (with the "NOT /xxx/" in paths).

So went with the choice of allowing a list of subdomains instead of excluding one.

But it doesn't work as expected..

I uploaded association file on both a.subdomain.domain.com and b.subdomain.domain.com. Even on subdomain.domain.com. AASA file contains "paths": ["*"]

In my app entitlements i specified "applinks:a.subdomain.domain.com" and "applinks:b.subdomain.domain.com"

Doesn't open anything. Feels like when i'm adding more than the domain itself in the entitlements it stops working completely.

"applinks:*.domain.com" is fine but opens all the subdomains.

"applinks:a.subdomain.domain.com", "applinks:*a.subdomain.domain.com" or even "applinks:*.subdomain.domain.com" breaks everything.

An i missing something? Haven't found anything about subdomain not being allowed in entitlements, the way it's explained in the official Apple doc it should be working...



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source