> ## 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

# 建立移動端賬戶

Expo、Apple、Google Play 和 RevenueCat 賬戶——各自用途以及何時建立。

## 什麼時候需要它們

日常移動端開發一個都不需要：Expo Go 加上執行中的後端——`apps/mobile/.env.local` 裡的 `EXPO_PUBLIC_API_URL`——就能覆蓋介面預覽和登入測試。

當你走出 Expo Go 時再建立這些賬戶：Expo 賬戶驅動 EAS 雲端構建，商店賬戶用於提交上架，RevenueCat 驗證原生內購，而 Apple 開發者計劃在商店稽核時也是 Sign in with Apple 的必需條件。其中兩個要花錢：Apple Developer 每年 99 美元，Google Play 一次性註冊費 25 美元；Expo 和 RevenueCat 都有免費層。

[先執行移動應用](https://supastack.dev/zh-tw/docs/mobile/ship-in-5-minutes.md)

[使用 AWS SDK 或 IAM SMTP 配置 Amazon SES](https://supastack.dev/zh-tw/docs/web/aws-ses.md)


## Expo + EAS

1. 開啟 [expo.dev](https://expo.dev) → Sign up，建立賬戶並確認郵箱。

2. 在終端執行 `npx eas-cli@latest login` 並輸入相同憑據——`eas` 是 Expo Application Services 構建與提交的命令列工具。

3. 在 `apps/mobile` 目錄下執行 `npx eas-cli@latest init`，把程式碼庫關聯到 EAS 專案；它會把專案 ID 寫入 `app.json`/`app.config.ts` 配置。`eas.json` 構建配置已隨套件附帶。

預期結果：`npx eas-cli@latest whoami` 列印你的賬戶名，專案出現在 expo.dev 儀錶板中。

```
npx eas-cli@latest login
cd apps/mobile
npx eas-cli@latest init
npx eas-cli@latest whoami
```


## Apple Developer Program

1. 開啟 [developer.apple.com](https://developer.apple.com) → Account → 註冊 Apple Developer Program——每年 99 美元；個人會員即可。

2. 註冊需要啟用雙重認證的 Apple ID，以及與你付款方式一致的法定姓名；審批可能需要一兩天。

3. 這一個賬戶覆蓋兩項要求：把 iOS 應用提交到 App Store，以及 Sign in with Apple——只要 iOS 應用提供 Google 或 GitHub 等第三方社交登入，App Review 就要求同時提供 Sign in with Apple。套件通過 `AUTH_APPLE_ENABLED` 加上後端的 `APPLE_CLIENT_ID`/`APPLE_CLIENT_SECRET` 憑據對來接入它。

同一個會員資格也覆蓋 macOS 桌面簽名——桌面賬戶指南會講那一側。


## Google Play Console

1. 開啟 [play.google.com/console](https://play.google.com/console)，支付一次性 25 美元註冊費，以你的名義或公司名義建立開發者賬戶。

2. 暫時停在開發者賬戶這一步——應用條目本身在提交時才在 Play Console 內建立：新應用的首次上傳始終在那裡手動完成，`eas submit` 從第二個版本開始接手。


## RevenueCat——僅當應用銷售內容時

如果移動應用不銷售數字內容或訂閱，可以完全跳過本節。如果銷售：1. 開啟 [revenuecat.com](https://www.revenuecat.com) 建立免費賬戶，2. 建立專案，3. 在專案中註冊 iOS 應用（連線 App Store Connect）和 Android 應用（Play 包名加服務憑據）。

4. 建立與商店商品對應的產品和一個 entitlement（權益）——套件在發放訪問許可權前會在服務端檢查配置的權益（`REVENUECAT_ENTITLEMENT_ID`、`REVENUECAT_ENTITLEMENT_KEY`）。

5. 把各平臺的公開 SDK 金鑰複製到 `apps/mobile/.env.local`，並按下面所示在兩側啟用服務商。SDK 金鑰是公開的客戶端值；`REVENUECAT_SECRET_API_KEY` 和 `REVENUECAT_WEBHOOK_AUTHORIZATION` 僅限服務端，屬於後端環境——絕不能放進 `EXPO_PUBLIC_` 變數。

[一步步設定 RevenueCat 購買](https://supastack.dev/zh-tw/docs/mobile/revenuecat.md)

```
# apps/mobile/.env.local
EXPO_PUBLIC_MOBILE_PURCHASES_PROVIDER=revenuecat
EXPO_PUBLIC_REVENUECAT_IOS_API_KEY=your-public-ios-sdk-key
EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY=your-public-android-sdk-key

# apps/web/.env.local — server side
MOBILE_PURCHASES_PROVIDER=revenuecat
REVENUECAT_SECRET_API_KEY=your-secret-api-key
REVENUECAT_WEBHOOK_AUTHORIZATION=your-webhook-auth-value
```


## 移動端的登入服務商

移動端登入複用你為 Web 建立的同一批 Google 和 GitHub OAuth 應用——回撥保持 `{APP_URL}/api/auth/callback/<provider>`，因為 Better Auth 處理服務端，而應用通過其 `EXPO_PUBLIC_APP_SCHEME` 深鏈 scheme 返回。僅僅因為客戶端是原生的，並不需要額外的服務商應用。

例外是 iOS 商店稽核：在 iOS 上提供 Google 或 GitHub 按鈕，必須同時提供 Sign in with Apple，所以上面的 Apple Developer 賬戶同時也是登入的依賴項。

[新增 Google 登入](https://supastack.dev/zh-tw/docs/web/google-sign-in.md)

[新增 GitHub 登入](https://supastack.dev/zh-tw/docs/web/github-sign-in.md)


## 完成的標誌

繼續之前檢查每個賬戶：`npx eas-cli@latest whoami` 列印你的 Expo 賬戶且專案出現在儀錶板中；Apple Developer 會員顯示 Active；Play Console 賬戶已存在；RevenueCat 專案列出兩個商店應用及其產品和權益，金鑰也在正確的 env 檔案中。

然後按順序繼續——連線專案，如果應用銷售內容則設定購買，為裝置構建，提交上架：

[連線專案到 EAS](https://supastack.dev/zh-tw/docs/mobile/eas-setup.md)

[設定 RevenueCat 購買](https://supastack.dev/zh-tw/docs/mobile/revenuecat.md)

[在裝置上構建和驗證](https://supastack.dev/zh-tw/docs/mobile/builds.md)

[釋出到應用商店](https://supastack.dev/zh-tw/docs/mobile/publishing.md)


如果你想繼續完成設定，可以閱讀《[設定 EAS](https://supastack.dev/zh-tw/docs/mobile/eas-setup.md)》。


## 下一篇

[設定 EAS](https://supastack.dev/zh-tw/docs/mobile/eas-setup.md)
