I have a project with a single app target that serves two environments, and two schemes, one for each env, using xcconfig files for defining environment-specific stuff.
I'm trying to figure this out for months, so I've tried multiple approaches throughout this period:
- Have a single domain in "Associated domains" in Xcode, defined as
webcredentials:X
where X gets replaced using a value from xcconfig. - Have two domain entries in "Associated domains"
webcredentials:PROD_DOMAIN
andwebcredentials:STAGING_DOMAIN
. - Have a different order of domains
Results are very interesting: whatever I do, whatever approach I take, password autofill works on staging, but doesn't work on production. I'm aware that we need to test production on Test Flight and AppStore builds. That's how we're testing it, and it's not working. Tested on multiple devices, on multiple networks (wifi + mobile data), in multiple countries.. you name it.
The server side team has checked their implementation a dozen times; it's all configured properly, in the exact same way across environments (except bundle ID, ofc).
We tried a couple websites for validating the apple-app-site-association file, and while all of those are focused on testing universal links, they all reported that the file is configured properly. Still, password autofill doesn't work.
I prefer not to share my app's domains publicly here. Ideally I would contact Apple Developer Support directly, but they now require a test project for that, and since 'a test project' is not applicable to my issue, I'm posting here instead.