Universal Links not opening in app (in dev)

I believe I have everything configured correctly for Universal Links to be working, but every method I try to launch a link just takes me to safari. Any ideas would be appreciated!

The app in question is not yet in the app store, but some previous versions are in TestFlight.

Entitlements file:

<plist version="1.0">
<dict>
  ...
  <key>com.apple.developer.associated-domains</key>
  <array>
    <string>webcredentials:o.s.com</string>
    <string>applinks:o.s.com</string>
    <string>webcredentials:p.d.org:3011?mode=developer</string>
    <string>applinks:p.d.org:3011?mode=developer</string>
    <string>applinks:p.d.org?mode=developer</string>
  </array>

p.d.org:3011 (not the real url) is a public DNS record that resolves to the LAN IP of my macbook where a dev instance of our server is running with a valid TLS certificate from Let's Encrypt.

o.s.com is the url of the our staging environment, which some TestFlight builds connect to.

The AASA file served by both servers is currently a combination of both old and new formats, but I originally just had what I believe to be the new format (from here):

{
  "applinks": {
    "apps": [],
    "details": [{
      "appIDs": [
        "the.real.app.id", // <--- redacted
        "the.second.app.id"
      ],
      "components": [{
        "?": "no_universal_link",
        "exclude": true,
        "comment": "Exclude any URL with no_universal_link in the query params"
      }, {
        "/": "/group/browse",
        "exclude": true,
        "comment": "Exclude group browse list"
      }, {
        "/": "/invited*",
        "comment": "Match invited link"
      }]
    }, {
      "appID:": "the.real.app.id",
      "paths": ["/invited*", "/group/*"]
    },  {
      "appID:": "the.second.app.id",
      "paths": ["/invited*", "/group/*"]
    }]
  },
  "webcredentials": {
    "apps": [
      "the.real.app.id",
      "the.second.app.id"
    ]
  },
  "activitycontinuation": {
    "apps": [
      "the.real.app.id",
      "the.second.app.id"
    ]
  }
}

I have two phones and an iPad I test on, one phone with the iOS beta installed (currently 15.5 beta 4) and one phone + the iPad with the current public iOS (15.4.1). On all devices, Settings->Developer->Associated Domains Development is ON.

Upon install of a Debug build of the.real.app.id, I confirmed that /.well-known/apple-app-site-association was fetched from my local dev server.

Settings->Developer->Universal Links->Diagnostics shows the following for https://p.d.org:3011:

for https://o.s.com, though, it show a problem, which I'm assuming is due to the debug build not matching a url with ?mode=developer:

In the AppDelegate, I've implemented:

func application(_ application: UIApplication, 
    continue userActivity: NSUserActivity,
    restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
  logger.info("continue user activity: \(userActivity.activityType, privacy: .public)")
  return true
}

and in the SwiftUI App subclass, I also have:

var body: some Scene {
  WindowGroup {
   MainContentView()
    .onContinueUserActivity(NSUserActivityTypeBrowsingWeb, perform: launchUrl(userActivity:))
    .onOpenURL { url in
     print("On open url: \(url)")
    }
  }
 }

func launchUrl(userActivity: NSUserActivity) {
  logger.info("launchUrl continue user activity: \(userActivity.activityType, privacy: .public)")
 }

I've sent myself messages with links to p.d.org:3011 in a number of apps, including iMessage. I've rendered a link into a QR code for use in the camera app. I've even built a second app into which I've hard coded the link to ensure that it calls UIApplication.shared.open(url, options: [:], completionHandler: nil). All of these methods take me to the browser (safari).

For completeness, I'm using the link: https://p.d.org:3011/invited?id=...

When the web opens, a blank app preview banner appears sometimes. I expect that it's blank because the app in question hasn't been publicly released to the app store yet. The landing page doesn't have enough content to scroll the page, and pulling down on the page doesn't reveal the app preview banner when the banner doesn't show.

The logging statements in the app never print.

I've also tried building both Ad Hoc and TestFlight versions of the app for o.s.com. Server logs similarly show the AASA being fetched. But the Diagnostics in Settings show the yellow triangle screen for both p.d.org:3011 and o.s.com.

I'm not sure what I'm doing wrong here, and I can't find any more information on the web. Can someone help me out ...or put me out of my misery?

Did you get anywhere with this?

I can see in my phone, Settings->Developer->Universal Links->Diagnostics, that my URL Opens Installed Application. But when i click the URL in an email or messenger, it just opens in safari

Nope... I post it to the feedback assistant site. They asked for a test case project, which I gave them, and I haven't heard anything back.

Still looking for some help

I found that my associated domain having ?mode=developer was preventing the universal link from opening my application. I removed it as my understanding this is only necessary if you want to skip the cached version of your apple-app-site-association from Apple's CDN. Once that file is cached and doesn't change, it doesn't matter anymore.

Where did Settings->Developer->Universal Links and Settings->Developer->Associated Domains Development go ??? no longer in Settings -> Developer

Simulators do not have any of the universal link options in developers, would have been nice to know

Same problem here. My device has "Associated Domains Development" option enabled. When I check my domain on Diagnostics, I get the green check mark, but on trying to tap the link somewhere, it opens the browser instead of calling my app. I don't have the associated file from website yet because I'm starting the development but I'm using the ?mode=developer parameter in the associated domains configuration.

Did you manage to get anywhere with this? Have you checked what links are being downloaded in the Sysdiagnose files on the device?

I have an issue at the moment where everything looks good in the CDN, but the links being download to the device when the app is installed are not bringing new links down (but still showing old ones). Any ideas?

I'm having similar issues, although maybe slightly different. Deep links are opening fine, but when I send a notification from Airship it launches the app and then immediately launches Safari with the url I sent. However the app banner shows in Safari and if I tap OPEN it will open my app to the page I expected from the url in the notification.

Universal Links not opening in app (in dev)
 
 
Q