Adding support for Apple App Site Association files to Jekyll

It’s pretty common for an iOS app these days to support universal links, iCloud credentials, App Clips and other functionality related to the Associated Domains entitlement. The tricky part can sometimes be that you don’t have a website or hosting to host the required apple-app-site-association file for the Apple CDN to pull.

At the time of writing, this blog was running on Jekyll and hosted by GitHub Pages. It now uses Cloudflare static hosting. There’s an excellent guide from GitHub if you’d like to do something similar - I was also using it to satisfy the App Store privacy policy requirement too.

For the AASA file, I had two requirements:

  • Upload a JSON file, named apple-app-site-association to the .well-known directory
  • Expose this file via my domain searle.dev at that location via Jekyll - this enables the Apple CDN to locate the file, and cache it, based on the domain(s) you specify in your app’s entitlements.

It turned out to be really simple, all that was needed was to create the folder and file in my root directory and then the key part - specify in my _config.yml file to include that location:

include: 
  - .well-known

There was some misleading information out there that lead me away from this simple approach initially - this works. The configuration above captures the change; the original source repository has now been retired.