App Clips not working

Issue:

  • after going through configuration steps for app clips, when I scan my QR code, my app clip does not appear, instead safari attempts to open the url as a web page.

note:

  • my aasa endpoint is never even getting called when scanning the QR code.

Setup:

  • App uninstalled in accordance with Apple Documentation "Users don’t install App Clips, and App Clips don’t appear on the Home Screen. Similarly, testers don’t install the beta version of your App Clip"
  • testflight installed in accordance with Apple Documentation
  • My app's Build 1.51.9 (1) uploaded and greenlit in testflight.
  • My apple email is added as an internal tester is the same as my Apple ID for the device used.
  • I have provided an aasa for the path: .well-known/apple-app-site-association. Here is my full url: https://akin-server-side-staging.onrender.com/.well-known/apple-app-site-association.
{
  "appclips": {
    "apps": [
   "8PJ28P9ZZ8.com.ElevatedUnderdogs.akin1.Clip"
    ]
  },
  "applinks": {
    "details": [
      {
        "components": [
          {
            "/": "/appClips/referral/venueToUser"
          }
        ],
        "appIDs": [
          "8PJ28P9ZZ8.com.ElevatedUnderdogs.akin1"
        ]
      }
    ]
  }
}
  • Here are my entitlements for my parent target:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>aps-environment</key>
	<string>development</string>
	<key>com.apple.developer.applesignin</key>
	<array>
		<string>Default</string>
	</array>
	<key>com.apple.developer.associated-domains</key>
	<array>
		<string>applinks:akin-server-side.onrender.com</string>
		<string>applinks:akin-server-side-staging.onrender.com</string>
		<string>appclips:akin-server-side-staging.onrender.com</string>
		<string>appclips:akin-server-side.onrender.com</string>
	</array>
	<key>com.apple.security.application-groups</key>
	<array>
		<string>group.com.ElevatedUnderdogs.akin1</string>
	</array>
</dict>
</plist>
  • Here are the entitlements for my app clip target:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.developer.associated-domains</key>
	<array>
		<string>applinks:akin-server-side-staging.onrender.com</string>
		<string>applinks:akin-server-side.onrender.com</string>
	</array>
	<key>com.apple.developer.parent-application-identifiers</key>
	<array>
		<string>$(AppIdentifierPrefix)com.ElevatedUnderdogs.akin1</string>
	</array>
	<key>com.apple.security.application-groups</key>
	<array>
		<string>group.com.ElevatedUnderdogs.akin1</string>
	</array>
</dict>
</plist>
  • On App Store Connect in the Testflight section for this project and build: Build 1.51.9 (1), Test Information -> App Clip Invocations I have the following:

copy pasted for convenience:

"no variables":"https://akin-server-side-staging.onrender.com/appClips/referral/venueToUser",
"Jeff referral":"https://akin-server-side-staging.onrender.com/appClips/referral/venueToUser?venueID=ChIJVaPxJnCej4ARyxiB9Tt2tG8&referrerName=Jeff"
  • Here is the QR code I attempted to scan,

https://akin-server-side-staging.onrender.com/appClips/referral/venueToUser?venueID=ChIJVaPxJnCej4ARyxiB9Tt2tG8&referrerName=Jeff

Thanks for the post, in this page you'll find a sample for AppClips as well as the first note will provide you the 101 of App Clips. I always recommend developers to go over all those videos and documentation liked on that note. Then download the app, look at every single configuration from that app including the Clip target!

https://developer.apple.com/documentation/appclip/fruta-building-a-feature-rich-app-with-swiftui

In my opinion and without going deep in your solution, the reason your AASA endpoint is never getting called when you scan the QR code is due to a common misconception about how iOS handles App Clips and Universal Links, the iOS device does not fetch the AASA file at the moment you scan a QR code. Downloads the file at app installation time and there is also a delay.

When you scan a QR code, iOS checks its local cache and Apple's CDN records to see if that URL is registered to an App Clip. If Apple's CDN hasn't validated your AASA file, or if the TestFlight configuration is incomplete, iOS falls back to standard behavior: opening the URL in Safari.

In Xcode, your App Clip target (and ideally your Main App target as well) must have the Associated Domains entitlement configured correctly.

It must be exactly: appclips:akin-server-side-staging.onrender.com

To force the device to bypass Apple's CDN and fetch the AASA file directly from your server, append ?mode=developer to your Associated Domains entitlement in Xcode:

appclips:akin-server-side-staging.onrender.com?mode=developer

If you do this, you will need to install the app via Xcode directly to the device once to force the local fetch, as TestFlight builds are considered production-signed and ignore the developer mode flag. However, it is highly recommended for debugging but never for deployment.

Hope this helps.

Albert Pascual
  Worldwide Developer Relations.

How do I clear the cache for app clips purposes?

It seems like you moved the TSI to the forums, thanks for doing that as more developers will be able to help you. Will be closing the TSI for now.

Albert Pascual
  Worldwide Developer Relations.

Okay. Good news. I got App Store to recognize 4 valid domains - not invalid, not empty but greenlit ✅. It turns out the team id that displays within Xcode doesn't match the team id in the portal for my paid account, and even continues displays the wrong team id for a provisioning profile made from the correct team id, which may be a bug. 🐛

@ScottyBlades That's not a bug on Xcode that's not setting the correct team you have a the entitlement to that team.

Make sure you configure the correct team. I would recommend to simplified your configuration to just one team to make it less confusing.

Albert Pascual
  Worldwide Developer Relations.

Update:

  • Even though App Store Connect is saying my domains are valid after correcting the team id, and the cdn cache has what appears to be proper values. App clips are still not working for me - meaning, every time I scan the QR code with the camera when the app isn't installed, it doesn't go to the app clip. If I get App Store to create an app code for me, it says no content to show (though this may be because the App Store is saying received for advanced app clip experiences I wrote).

So I checked the CDN here: https://app-site-association.cdn-apple.com/a/v1/akin-server-side-staging.onrender.com, I can see my aasa is proper to my understanding in the CDN cache.

I updated the entitlements as recommended: appclips:akin-server-side-staging.onrender.com

I also reviewed several Apple Documentation pages including the Fruta, downloaded, Fruta and examined the configuration part by part. Specifically, the entitlements for both the app clips and parent target.

On my iOS device, I went to Settings > Developer > App Clips > Diagnostics, and tested the url: https://akin-server-side-staging.onrender.com/appClips/referral/venueToUser?venueID=ChIJ5cDDPpa1j4ARj2v92aO3LRc&referrerName=Jeff and https://akin-server-side-staging.onrender.com/appClips/referral/venueToUser. And in both cases, the diagnostic report is implying the associated domains are not proper for it.

I checked my metadata and my app clip is 11.7mb under the iOS 16.0 max allowance.

Still not working for me yet. @DTS Engineer

App Clips not working
 
 
Q