Skip to content
FunnelGuard

Fix guide by FunnelsGuard

apple-app-site-association malformed: how to find and fix it

APP-010High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Universal Links let a normal web link (such as https://example.com/offer) open your iOS app directly. iOS decides whether to allow this by reading a file on your domain called apple-app-site-association, served at https://example.com/.well-known/apple-app-site-association.

This issue is about the content of that file being wrong. Three common faults: the JSON is malformed (a trailing comma, a missing bracket, a BOM or stray HTML at the top), the file is over 128 KB, which is Apple's size limit, or an app ID is not in the TEAMID.bundleID form. A missing file, a redirect or a login wall is a different problem (see the related guide on a missing or HTML-served file).

A valid minimal apple-app-site-association filejson
{
  "applinks": {
    "details": [
      {
        "appIDs": ["9JA89QQLNQ.com.example.app"],
        "components": [
          { "/": "/offer/*" },
          { "/": "/lp/*" }
        ]
      }
    ]
  }
}

Why it costs you leads or sales

When the file is rejected, iOS treats your links as ordinary web links. People who tap an ad, email, SMS or QR code with the app installed land on a mobile web page instead of the in-app screen you planned. They may have to log in again, lose their cart, or see a weaker experience. Many will drop off.

It is also hard to notice. The links still work, only in the wrong place, so nothing looks broken on a desktop check and no error appears in your ad platform.

Where a malformed AASA file breaks the path
  1. Ad or email linkUser taps https://example.com/offer
  2. iOS reads AASAInvalid JSON, over 128 KB or bad app ID
  3. App opens at the offerNever happens
  4. In-app purchase or sign-upNot reached

iOS cannot validate the file, so the app never opens.

Installed-app users reaching the in-app offerExample numbers
Installed-app users reaching the in-app offer (example)Broken AASA: 0 %; Valid AASA: 100 %038770100Broken AASAValid AASA%

Example: illustrative numbers only, showing how many installed-app users reach the in-app screen before and after the file is fixed.

How to check if your site has it

Inspect your file
  1. Download the file

    Run curl -i https://yourdomain.com/.well-known/apple-app-site-association and confirm a 200 status with no redirect.

  2. Check the size

    Run curl -s URL | wc -c. The result must be under 131072 bytes (128 KB).

  3. Validate the JSON

    Pipe the output to a validator, for example curl -s URL | python3 -m json.tool. Any error means the file is malformed.

  4. Check each app ID

    Every entry in appIDs (or the older apps/appID fields) must be your 10-character Apple Team ID, a dot, then the exact bundle ID. Find the Team ID in your Apple Developer account under Membership details.

  5. Test on a device

    Send yourself the link in Notes or Messages on an iPhone with the app installed and long-press it. You should see an Open in app option.

Quick command-line checksbash
URL=https://yourdomain.com/.well-known/apple-app-site-association
curl -sI "$URL" | head -n 5
curl -s "$URL" | wc -c
curl -s "$URL" | python3 -m json.tool > /dev/null && echo "valid JSON"
Common app ID mistakes
Written asProblemCorrect form
com.example.appNo Team ID9JA89QQLNQ.com.example.app
9JA89QQLNQ-com.example.appDash instead of dot9JA89QQLNQ.com.example.app
com.example.app.9JA89QQLNQReversed order9JA89QQLNQ.com.example.app
App ID prefix copied from an old profileWrong Team IDUse the current Team ID from Membership details

How to fix it

Repair the file
  1. Fix the JSON syntax

    Remove trailing commas, close all brackets, use double quotes, and save as plain UTF-8 without a BOM or any HTML wrapper.

  2. Correct the app IDs

    Write each as TEAMID.bundleID. If you ship several apps or variants, list each one.

  3. Reduce the size

    If the file is near or over 128 KB, replace long lists of paths with wildcard patterns such as /offer/*, and remove old or unused entries.

  4. Serve it correctly

    Keep it at /.well-known/apple-app-site-association with no file extension, over HTTPS, with Content-Type application/json and no redirect.

  5. Match the app

    Make sure the app's Associated Domains entitlement contains applinks:yourdomain.com. Changing this needs a new app build.

Where to edit the file by platform
  1. Edit the physical file

    Via SFTP or your host's file manager, edit .well-known/apple-app-site-association in the site root. If a plugin generates it, fix the app ID and paths in that plugin's settings instead.

  2. Check the content type

    If the file downloads or shows as text/plain or HTML, add a rule in .htaccess or your server config to serve it as application/json.

nginx: serve the file as JSON with no redirectnginx
location = /.well-known/apple-app-site-association {
    default_type application/json;
    try_files $uri =404;
}

How to confirm it's fixed

Confirmation checks
  • The URL returns 200 with no redirect
  • The response parses as valid JSON
  • The file is well under 128 KB
  • Every appID is TEAMID.bundleID with the correct Team ID
  • Your campaign paths match a rule in components (or paths)
  • On a real iPhone with the app installed, long-pressing the link shows Open in app
  • A fresh install of the app (or a reinstall) picks up the change

How to prevent it happening again

Keep the AASA file in version control and validate it in your deployment pipeline: parse the JSON, check its size, and match each app ID against a TEAMID.bundleID pattern. Re-check it after any change of Apple developer account, bundle ID, CDN, caching rule or site migration, since these often rewrite or drop the file.

Simple CI checkbash
f=.well-known/apple-app-site-association
python3 -m json.tool "$f" > /dev/null || exit 1
[ $(wc -c < "$f") -lt 131072 ] || exit 1
grep -Eq '"[A-Z0-9]{10}\.[A-Za-z0-9.-]+"' "$f" || exit 1

How FunnelGuard handles this

FunnelGuard detects this issue today. Its app_site_association check fetches your apple-app-site-association file and looks at the file itself: whether it parses as valid JSON, whether it is within the 128 KB limit, and whether the app IDs are in TEAMID.bundleID form. If the check fails, you get an alert with a likely cause.

FunnelGuard does not open your iOS app, so it cannot prove a link opens in-app on a phone. Keep a manual device test after changes. You can start with the Free plan (1 site, 2 journeys, daily checks, no card) or run the free read-only website audit.

Questions people ask

Why are my Universal Links opening in Safari instead of my app?

A common cause is an apple-app-site-association file that iOS rejects. It may be invalid JSON, over 128 KB, or list an app ID that is not in TEAMID.bundleID form. Other causes include a missing Associated Domains entitlement or a path your rules do not cover.

What is the size limit for the apple-app-site-association file?

Apple limits the file to 128 KB. Larger files are ignored, so Universal Links stop working. Shorten it with wildcard patterns and remove unused entries.

What is the correct format for an app ID in apple-app-site-association?

Use your 10-character Apple Team ID, a dot, then the bundle ID, for example 9JA89QQLNQ.com.example.app. You can find the Team ID in your Apple Developer account under Membership details.

How do I validate my apple-app-site-association file?

Download it with curl, check the byte count is under 131072, and run it through a JSON validator such as python3 -m json.tool. Then confirm each app ID format and test a link on an iPhone with the app installed.

Does the apple-app-site-association file need a .json extension?

No. It must be served without any extension at /.well-known/apple-app-site-association over HTTPS, with no redirect. The content type should be application/json.

Why didn't my fix work straight away?

Apple fetches the file through its own CDN and devices pick up changes later, often when the app is installed or updated. Your fix may take time to appear, so retest after a reinstall.

Can FunnelGuard tell me if my apple-app-site-association file is malformed?

Yes. FunnelGuard's app_site_association check looks at the file for valid JSON, the 128 KB limit and correctly formed app IDs, then alerts you if it fails. It does not open your app on a real phone.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: app_site_association.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.