r/iOSProgramming • • 10d ago

Question Universal Links always open Safari instead of my app, but one link path works. Apple CDN seems to be serving a stale AASA?

Post image

Universal Links always open Safari instead of my app, but one link path works. Apple CDN seems to be serving a stale AASA?

Setup:

Universal Links with an AASA file hosted at the standard /.well-known/ location
Associated Domains entitlement is set up correctly
The app is live on the App Store

Problem:
The invite-a-friend link (/invite/...) opens the app correctly

My other link paths always open the web page in Safari instead of the app, even after reinstalling

What I've already checked:
The AASA file is served over HTTPS with a 200 status, no redirects, and Content-Type: application/json

I validated it with an online AASA validator and an AI-assisted audit. The JSON is valid, and the Team ID + Bundle ID are correct
The paths/components entries include the failing paths

I tested by pasting the link in Notes and long-pressing it (it doesn't show "Open in [App]"), and also from Messages

Any experience or tips would be really appreciated. Thanks!

7 Upvotes

17 comments sorted by

2

u/Needle_In_Red 9d ago

worth checking https://app-site-association.cdn-apple.com/a/v1/yourdomain.com to see what apples cdn actually has cached, if its the old file you just gotta wait it out (can take a day or so)

1

u/Vast_Journalist1415 9d ago

okkay thx u, it’s really help me

2

u/shurco 9d ago

since /invite opens the app, association and team id are already fine. diff apple's cached aasa with your origin file, because a pattern miss looks exactly like a stale cdn.

1

u/Vast_Journalist1415 8d ago

okkay thx u its make me better

4

u/unpluggedcord 10d ago

add ?mode=developer To your app links in Xcode , this should unlock until the CDN is updated.

4

u/Artuplabs 9d ago

besides the CDN delay, two things make universal links look broken when they're not. tapping a link to the same domain from a page already on that domain in Safari never opens the app, and if you ever long pressed a link and picked "Open in Safari", iOS remembers that per domain until you long press again and pick "Open in [app]". so test by tapping from Notes or Messages. on iOS 16+ there's also Settings > Developer > Universal Links > Diagnostics where you can paste a link and see what the system thinks about it, that's quicker than guessing from the validator.

1

u/InteractionWrong4029 9d ago

Check Apple's own copy of the file before touching the app: Apple serves AASA from app-site-association.cdn-apple.com/a/v1/yourdomain, and that cached copy can lag your origin by up to a day. If the working path is in the CDN copy and the newer paths are not, nothing on the device will fix it — a reinstall just pulls the same stale file again.

Two other things that produce exactly this "one path works" pattern: links tapped inside Safari never open the app by design, so test from Notes/Messages only; and components entries are matched in order, so a broader entry placed above your failing paths swallows them.

Diff the CDN copy against your origin first. It is one request and it separates a cache problem from a config problem immediately.

0

u/gilgoomesh 10d ago

Apple's CDN takes about a week to update.

On iOS 14 and later, Apple’s CDN retrieves and caches the AASA file. When your app is installed, devices download the file from the CDN immediately. Devices check for updates approximately once per week after app installation. To download a newer version of the AASA file, reinstall the app. There is no direct CDN invalidation option.

https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links

2

u/unpluggedcord 10d ago

Unfortunately that's wildly out of date, you can add ?mode=developer

1

u/[deleted] 10d ago

[removed] — view removed comment

1

u/Vast_Journalist1415 9d ago

Thank you for the advice, this is the first time for me to eat, I’m a little confused, I’ve been careful every step.. I’m very grateful

1

u/[deleted] 9d ago

[removed] — view removed comment

1

u/AutoModerator 9d ago

Hey /u/Favid-Castaing, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

0

u/[deleted] 10d ago

[removed] — view removed comment

1

u/AutoModerator 10d ago

Hey /u/pujun125, your content has been removed because Reddit has marked your account as having a low Contributor Quality Score. This may result from, but is not limited to, activities such as spamming the same links across multiple subreddits, submitting posts or comments that receive a high number of downvotes, a lack of recent account activity, or having an unverified account.

Please be assured that this action is not a reflection of your participation in our subreddit. This is simply an automated filter in place to reduce spam.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.