Static redirect site for Anatomy Quiz: Trivia Body Game.
Live site: https://digigene.github.io/anatomyquiz_redirect/
- Default: redirects mobile visitors to Google Play / App Store; desktop visitors see both store buttons.
- Campaign links: supports
?source=and?medium=UTM-style tracking on store URLs. - Challenge invites: URLs like
https://digigene.github.io/anatomyquiz_redirect/challenge/<inviteCode>:- Generate/persist a
deviceUidinlocalStorage(or reuse?deviceUid=from the URL) - Append
?deviceUid=<uuid>to the invite URL viahistory.replaceStateso deferred App Links carry the same UUID POSTto backendrecordDeferredInvitewith{ deviceUid, inviteCode }- Redirect the user to the app store (Play Store referrer also includes
deviceUidon Android) - After install, the app resolves the deferred invite using the same
deviceUidat guest login
- Generate/persist a
CHALLENGE_INVITE_URL_BASE in AWS SSM should be:
https://digigene.github.io/anatomyquiz_redirect/challenge
Android App Links and iOS Universal Links are verified at the org Pages root repo digigene/digigene.github.io:
https://digigene.github.io/.well-known/assetlinks.jsonhttps://digigene.github.io/apple-app-site-association
Deploy that repo (with the ANDROID_PLAY_SIGNING_SHA256 secret set) before expecting challenge invite links to open the installed app directly.
- In the
digigene/anatomyquiz_redirectrepo settings, enable GitHub Pages from GitHub Actions or deploy frommain. - Push to
main— the workflow publishes the static site. No generated config files are required;redirect.jsincludes the production API base URL.
The browser fetch to recordDeferredInvite requires CORS on BodyQuizRestApiBase (r2fihr72e5). Allow origin https://digigene.github.io with methods POST, OPTIONS and header content-type.
aws apigatewayv2 update-api \
--api-id r2fihr72e5 \
--cors-configuration 'AllowCredentials=false,AllowHeaders=content-type,AllowMethods=POST,AllowMethods=OPTIONS,AllowOrigins=https://digigene.github.io,MaxAge=300'python3 -m http.server 8080Then open e.g. http://localhost:8080/challenge/ABCD (you may need to serve via a path-aware setup; GitHub Pages uses 404.html for deep challenge links).
To point at a non-production API, set window.AQ_CONFIG before redirect.js loads:
<script>window.AQ_CONFIG = { apiBaseUrl: "https://your-api.example.com/prod" };</script>
<script src="redirect.js"></script>| File | Purpose |
|---|---|
index.html |
Main landing page |
404.html |
Same as index.html; GitHub Pages serves this for /challenge/<code> deep links |
redirect.js |
Store redirect + challenge invite handling (includes production API base URL) |