> ## Documentation Index
> Fetch the complete documentation index at: https://supastack.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For the full documentation corpus in one file, fetch: https://supastack.dev/llms-full.txt

# 深連結與應用配置

URL scheme、介面路由表，以及打包配置的契約。

## 一個環境變數派生 scheme

EXPO_PUBLIC_APP_SCHEME 提供給 apps/mobile/app.config.ts，後者通過登入流程所用的同一套移動認證配置，派生出深連結 scheme 與生產允許來源。該值會經過校驗 —— 只允許小寫 scheme 字元 —— 且 http、https、file、javascript、data、exp、exps 等保留 scheme 會被拒絕。出廠預設值為 supastack。

app.json 中兩個識別符號出廠均為 com.supastack.app（ios.bundleIdentifier 與 android.package）；首次上傳商店前，請連同 scheme 一起改名。

```
# apps/mobile/.env.local
EXPO_PUBLIC_APP_SCHEME=supastack
```


## 應用接受的連結形態

深連結僅支援自定義 scheme：<scheme>://auth/callback 完成一次登入交接，<scheme>://invite/<token> 開啟邀請介面並把 token 提交到邀請接受路由。未配置 universal link —— app.json 沒有宣告 associatedDomains —— 因此所有連結都經 scheme 解析。

apps/mobile/app 下的 expo-router 路由表：index 是登入介面，onboarding 與 new-organization 處理首次執行設定，paywall 呈現購買，feedback 是未登入也可用的獨立介面。(app) 組內的標籤頁為 home、chat、notifications、settings；content、commerce、assistant 是從首頁快捷操作進入的隱藏介面，settings 還包含自己的子介面棧。


## 打包意味著兩側必須一致

公開的 Expo 值會被烘進分發的二進位制包，而伺服器按請求用 MOBILE_ALLOWED_ORIGINS 校驗移動端回撥。這對值必須匹配：修改 scheme 或來源意味著同時釋出新應用構建與伺服器部署，絕不能只改一邊。


## 沒有 OTA 更新通道

套件不附帶 expo-updates 依賴，也沒有 updates 配置 —— JavaScript 改動只能通過新的商店構建觸達使用者。保持 API 相容最舊的受支援構建，或用服務端驅動的狀態來門控新能力。


## 驗證與排障

測試冷啟動連結、應用在後臺執行時到達的連結，以及未登入狀態下收到的連結。如果連結開啟的是商店頁面或瀏覽器而不是應用，說明已安裝構建的 scheme 與 EXPO_PUBLIC_APP_SCHEME 不一致。


## 下一篇

[原生 UI 與主題](https://supastack.dev/zh-tw/docs/mobile/ui.md)
