From d7afad349fd8f4ffcaecc1d364b6301a407fe220 Mon Sep 17 00:00:00 2001 From: kirukib Date: Tue, 17 Nov 2026 23:02:40 +0300 Subject: [PATCH] Remove hard-coded domains; default to localhost and env config Co-Authored-By: Claude Opus 5.5 --- README.md | 27 ++++++--------------------- app.json | 11 +---------- src/app/q/[token].tsx | 2 +- 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 25471ce..b738fce 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,6 @@ The QR scanner needs a real device camera (the web build and simulators fall bac code under the QR). - **Expo Go**: `pnpm start`, scan the terminal QR with Expo Go (Android) or the Camera app (iOS). - Everything works except universal/app links (`https://grv.ethiopiatrustfund.org/q/...`); - test those with the dev client. - **Dev client**: `eas build --profile development --platform ios|android`, install it, then `pnpm start` and open the project from the dev client. @@ -53,26 +51,13 @@ Bundle id / package: `org.ethiopiatrustfund.grvsummit`. Scheme: `grvsummit`. ## Deep links -Printed checkpoint QRs encode `https://grv.ethiopiatrustfund.org/q/`. With the app -installed, the phone's camera opens the app on `src/app/q/[token].tsx`, which calls -`POST /scan` once and shows the result (signed-out users go through login first and come back). -`grvsummit://q/` works too (handy for testing: `npx uri-scheme open grvsummit://q/abc --ios`). +Printed checkpoint QRs encode `/q/` (backend `SITE_URL`). That site page opens +`grvsummit://q/`, which lands on `src/app/q/[token].tsx`: it calls `POST /scan` once and shows +the result (signed-out users go through login first and come back). Inside the app, the Scan tab +reads the same codes directly. Test: `npx uri-scheme open grvsummit://q/abc --ios`. -Configured in `app.json`: - -- iOS `associatedDomains: ["applinks:grv.ethiopiatrustfund.org"]` -- Android `intentFilters` for `https://grv.ethiopiatrustfund.org/q/*` with `autoVerify` - -The site must serve the verification files (not done here; belongs in the GRVSummit site): - -- `https://grv.ethiopiatrustfund.org/.well-known/apple-app-site-association` - ```json - { "applinks": { "details": [{ "appIDs": [".org.ethiopiatrustfund.grvsummit"], "components": [{ "/": "/q/*" }] }] } } - ``` -- `https://grv.ethiopiatrustfund.org/.well-known/assetlinks.json` with the package name and the - release signing SHA-256 (`eas credentials` shows it). - -Without the app, the same URL opens the website's `/q/` page. +Universal/app links (camera opens the app without the site page) need a domain; add iOS +`associatedDomains`, Android `intentFilters` and the site's `.well-known` files once there is one. ## Layout diff --git a/app.json b/app.json index 76e33f5..3636885 100644 --- a/app.json +++ b/app.json @@ -10,7 +10,6 @@ "ios": { "supportsTablet": false, "bundleIdentifier": "org.ethiopiatrustfund.grvsummit", - "associatedDomains": ["applinks:grv.ethiopiatrustfund.org"], "infoPlist": { "ITSAppUsesNonExemptEncryption": false } @@ -20,15 +19,7 @@ "adaptiveIcon": { "foregroundImage": "./assets/adaptive-icon.png", "backgroundColor": "#30614c" - }, - "intentFilters": [ - { - "action": "VIEW", - "autoVerify": true, - "data": [{ "scheme": "https", "host": "grv.ethiopiatrustfund.org", "pathPrefix": "/q/" }], - "category": ["BROWSABLE", "DEFAULT"] - } - ] + } }, "web": { "bundler": "metro", diff --git a/src/app/q/[token].tsx b/src/app/q/[token].tsx index 73e5001..3ef0f30 100644 --- a/src/app/q/[token].tsx +++ b/src/app/q/[token].tsx @@ -24,7 +24,7 @@ const who = (c: Checkpoint) => .join(' · ') : [c.personName, c.label, c.organisation].filter(Boolean).join(' · '); -/** Reached from the Scan tab and from https://grv.ethiopiatrustfund.org/q/ deep links. */ +/** Reached from the Scan tab and from grvsummit://q/ deep links (the site's /q page opens these). */ export default function ScanResultScreen() { const { token } = useLocalSearchParams<{ token: string }>(); const [state, setState] = useState({ kind: 'loading' });