Links Worker

Overview

The links Cloudflare Worker serves two distinct purposes from links.floatme.io (prod) and links.test.floatme.io (test):

  1. .well-known file hosting — serves Apple App Site Association (AASA) and Google Digital Asset Links files that enable iOS Universal Links and Android App Links respectively.

  2. Deeplink routing — all other GET requests return 200 OK with an empty body (the domain itself acts as the registered Universal Link / App Link domain; iOS and Android intercept the navigation before the browser renders it).

The deeplink redirect to floatme://…​ is handled natively by the OS (iOS / Android) using the .well-known files this worker serves — the worker does not perform an HTTP redirect to the custom scheme itself.

Source

cloudflare/workers/links/

File Purpose

index.ts

Entry point; route matching and .well-known file dispatch

wellknown.ts

Static JSON payloads for Apple AASA and Google assetlinks.json (prod and test variants)

wrangler.toml

Worker name, routes, and WORKER_ENV variable

secrets.sh

Uploads DATADOG_API_KEY via wrangler secret put

Routes

Method Path Description

GET

/.well-known/apple-app-site-association

Apple AASA file (prod or test payload based on WORKER_ENV)

GET

/.well-known/assetlinks.json

Google Digital Asset Links file (prod or test payload)

GET

*

All other paths return 200 OK with empty body (deeplink intercept pass-through)

non-GET

*

405 Method Not Allowed

.well-known File Hosting

The static payloads are defined in wellknown.ts and selected at runtime by WORKER_ENV.

Apple App Site Association (apple-app-site-association)

The AASA file enables iOS Universal Links. The worker serves a different payload for prod vs test, referencing different app bundle IDs.

Table 1. App IDs
Environment App ID

prod

78MB648DK2.com.FloatMe.FloatMe-iOS-V1

test

78MB648DK2.com.FloatMe.FloatMe-iOS-V1.dev

Table 2. Supported path components (both environments)
Pattern Matches

/link/*

Any URL under /link/ — app deeplinks

/login/*

Any URL under /login/ — login deeplinks

The file also declares webcredentials for the same app ID, enabling AutoFill credential association.

The assetlinks.json file enables Android App Links.

Table 3. Android package names
Environment Package name

prod

io.floatme.floatmeapp

test

io.floatme.floatmeapp.dev

Both environments share the same SHA-256 certificate fingerprint:

3B:EA:74:F3:95:29:BF:E2:14:9F:9D:87:EB:CE:E3:D5:
FD:8B:AF:21:7E:20:0D:5C:67:5B:14:DB:1D:6E:83:40

The relation declared is delegate_permission/common.handle_all_urls.

links.floatme.io is the registered Universal Link (iOS) and App Link (Android) domain for the FloatMe mobile app. When the mobile OS opens a URL on this domain, it intercepts the navigation and opens the app directly if installed, without ever making a network request to the worker.

The worker only participates in the initial verification step: iOS and Android download the .well-known files to confirm the domain→app association. Once verified, all subsequent deeplink navigations are OS-handled.

The supported deeplink path patterns (as declared in the AASA) are:

URL pattern Triggered when

https://links.floatme.io/link/*

App deeplinks (e.g. shared referral links, in-app feature links)

https://links.floatme.io/login/*

Login-related deeplinks (e.g. magic link, email verification redirect)

If the app is not installed, the OS falls back to opening the URL in the browser. The worker returns 200 OK with an empty body for these paths, so the browser shows a blank page. A future improvement would be to redirect unarmed deeplinks to the app store.

Environment Variables

Variable Kind Description

WORKER_ENV

var

prod or test; selects which AASA / assetlinks payload to serve

DATADOG_API_KEY

secret

Datadog ingest key for structured log shipping

Upload secrets with:

make secrets.links.host

Local Development

make links.local

This invokes:

wrangler dev cloudflare/workers/links/index.ts \
  -c cloudflare/workers/links/wrangler.toml

No --env flag is passed; wrangler uses the top-level defaults from wrangler.toml (worker name links-local, route localhost/*). WORKER_ENV is not set in the top-level defaults, so it will be undefined; the worker falls back to the prod payloads (since the === 'test' check is false). Set WORKER_ENV=test in a .dev.vars file if you need to exercise the test payloads locally.

Wrangler starts a local HTTP server (default port 8787). Example requests:

# Fetch Apple AASA
curl http://localhost:8787/.well-known/apple-app-site-association

# Fetch Google assetlinks
curl http://localhost:8787/.well-known/assetlinks.json

# Deeplink pass-through (returns 200 empty)
curl http://localhost:8787/link/referral/abc123

See Also