Universal Links not working even though all debug steps succeed

I am trying to get universal links to work in our app Firefox iOS

The Problem:

I am not able to get universal links to work for our release app or beta app scheme locally or with a TestFlight build.

I am able to get it working on our development scheme with a locally hosted app site association file. I also was able to get it working using our development scheme but setting the bundle id to the release app bundle id. I also built a demo app with the release app id and the release app development certificate. It succeeded there as well.

Implementation Steps:

  • Added associated domains entitlement to the production and beta schemes for our main app target (No associated domains entitlements or capabilities added for any extensions)
  • Confirmed that the bundle ids associated with these schemes have the associated domains capability
  • Added applinks:blog.mozilla.org to associated domains list
  • Confirmed in code that user activities are being handled via SceneDelegate.swift

Steps to Debug:

I have gone through and validated every step in the provided Universal Link Debugging. All were successful:

  • Associated Domains Development -> Diagnostics: Opens Installed App
  • Validate AASA host and applinks match
  • curl -v https://blog.mozilla.org/.well-known/apple-app-site-association returns the expected json file
  • swcutil dl correctly downloads the AASA blob
  • swcutil verify succeeds

I have inspected the IPA of our beta build and confirmed the App ID and the associated domains is an entitlement.

I have looked at the console logs filtering by swcd. I am not seeing any errors and I see the download for the AASA file kick off:

Beginning data task AASA-4BABF039-3C69-4E36-AA4E-ECCDF3D14878 { domain: bl….mo….org, bytes: 0, route: cdn }

There is only one error that appears in the console but our app is not enterprise-managed so I assume this is normal.

Error getting enterprise-managed associated domains data. If this device is not enterprise-managed, this is normal: Error Domain=SWCErrorDomain Code=1701 "Failed to get associated domain data from ManagedConfiguration framework." UserInfo={NSDebugDescription=Failed to get associated domain data from ManagedConfiguration framework., Line=298, Function=<private>}

I have run Sysdiagnos and identified for our App ID:

Site/Fmwk Approval:   approved

I am at a loss as to what is preventing universal links from working even though all validation steps pass.

Update:

Based on the documentation in Debugging Universal Links I updated the associated domains to use the wildcard instead of blog.mozilla.org but it still is not working.

It is now: applinks:*.mozilla.org

Thank you for sharing your post and providing a thorough troubleshooting guide. It appears that you have already addressed the most common issues. A brief review suggests that everything is functioning correctly. The app ID belongs to the same team.

One thing to consider is verifying that the app ID team remains the same in the TestFlight build. Additionally, ensure that the application links are registered with or without the mode=developer parameter: applinks:blog.mozilla.org?mode=devel.oper as well.

To access the developer mode, applinks, your application must be signed with the same development profile. It is unlikely that this is the case for your TestFlight distribution. Check the team ID 43AQ936H96.

I can quickly access the AASA file, and it is publicly available:

curl -v https://app-site-association.cdn-apple.com/a/v1/blog.mozilla.org

sudo swcutil dl -d blog.mozilla.org --verbose            
Password:
{
    applinks =     {
        details =         (
                        {
                appID = "43AQ936H96.org.mozilla.ios.Firefox";
                components =                 (
                                        {
                        "/" = "/en/products/firefox/firefox-tips/online-shopping-tips/*";
                        comment = "Matches the specific test URL under /en/products/firefox/firefox-tips/online-shopping-tips on blog.mozilla.org";
                    }
                );
            },
                        {
                appID = "43AQ936H96.org.mozilla.ios.FirefoxBeta";
                components =                 (
                                        {
                        "/" = "/en/products/firefox/firefox-tips/online-shopping-tips/*";
                        comment = "Matches the specific test URL under /en/products/firefox/firefox-tips/online-shopping-tips on blog.mozilla.org";
                    }
                );
            }
        );
    };
}

Here’s a helpful resource, especially if your device is “managed” or using the developer provisioning profile: https://developer.apple.com/documentation/bundleresources/entitlements/com.apple.developer.associated-domains?language=objc

When debugging your app and using a distribution for TestFlight, ensure you remove the ?mode=developer parameter from the app links and use a device without developer mode enabled.

Another thing to check is if the AASA file was successfully downloaded when the app was installed. You can verify this by checking the sysdiagnose file on a device where the AASA file failed to download. Specifically, I’ll be looking for the swcutil_show file within the sysdiagnose, which may contain errors that provide insights into the issue.

If everything checks out, I recommend sharing a link to the TestFlight IPA app for me to download and test. However, sharing this publicly in the Forums is not advisable. Instead, I suggest submitting a code-level support request so we can discuss this matter privately.

When creating the support request, kindly indicate that I referred you to it and include a link to this thread.

Albert Pascual
  Worldwide Developer Relations.

Universal Links not working even though all debug steps succeed
 
 
Q