ShieldActionDelegate uses a different webDomain than the one I shielded

I shield a web domain picked by users like this (discouragedSelections is an instance of FamilyActivitySelection() btw) :

let webDomainTokens = discouragedSelections.webDomainTokens
store.shield.webDomains = webDomainTokens

The domain is correcly shielded and I can see the restricted screen when I access it via Safari.

When I tap on the main button of that restricted view, I receive a different token than the one I got from .webDomainTokens from the code above. Why?

override func handle(action: ShieldAction, for webDomain: WebDomainToken, completionHandler: @escaping (ShieldActionResponse) -> Void) {
		// webDomain here is different from the one in store.shield.webDomains
	}

Might be related to this issue, reported a couple of months ago. Still no reply / comment / workaround from apple. they dont seem to care unfortunately.

https://developer.apple.com/forums/thread/758325

I often face this issue on my phone.

I've noticed that in the Shield Configuration Extension, the domain string returned by Apple always starts with www.. If I select a domain starting with www. in the Family Controls picker, everything works fine.

But if I pick a domain without www., the token doesn't match. It seems there's a mismatch between the domain string from the Family Controls picker and the one sent by Apple in the Shield Configuration Extension.

Since the domain name surely influences the token generation, a simple www. changes the token.

Of course, we can't control if a web domain includes a www. or not in the Family Controls Picker which is very frustrating...

ShieldActionDelegate uses a different webDomain than the one I shielded
 
 
Q