diff --git a/doc/local-ios-testing-ngrok.md b/doc/local-ios-testing-ngrok.md index 48e86800..36ed88e4 100644 --- a/doc/local-ios-testing-ngrok.md +++ b/doc/local-ios-testing-ngrok.md @@ -163,9 +163,24 @@ curl -sS "$NGROK_URL/health" --- -## 4. Firebase + APNs setup (first-time setup) +## 4. Generate and open the iOS workspace -Complete this section once before your first physical-device push test. If Firebase and APNs are already configured for this app, skip to [section 5](#5-build-and-run-the-ios-app-physical-device). +From **crowd-funder-for-time-pwa**, generate the Capacitor iOS project and open it in Xcode. **[Section 5](#5-firebase--apns-setup-first-time-setup) (Firebase + APNs)** needs this workspace—for example to add `GoogleService-Info.plist` and enable Push Notifications in the app target. The app does not need Firebase or push fully configured yet; the goal here is a buildable Xcode project on your Mac. + +```bash +npm install +npm run build:ios:dev # or build:ios:test — non-production for debug panel +``` + +Open the generated Xcode workspace (for example `ios/App/App.xcworkspace`), select your **physical iPhone**, enable signing, and Run when you are ready to verify the app launches. + +Ensure `VITE_FIREBASE_*` variables are set for the Capacitor build you use (see `.env` / build docs). Native push registration runs at startup via `initializeNativePushAndFirebaseMessaging()` in `main.capacitor.ts` once Firebase is configured in the next section. + +--- + +## 5. Firebase + APNs setup (first-time setup) + +Complete this section once before your first physical-device push test. If Firebase and APNs are already configured for this app, skip to [section 6](#6-configure-the-notification-debug-panel-backend-override). ### Create or access a Firebase account @@ -197,7 +212,7 @@ Complete this section once before your first physical-device push test. If Fireb ### Add GoogleService-Info.plist to Xcode -1. Open the iOS workspace generated by Capacitor (for example `ios/App/App.xcworkspace` after `npm run build:ios:dev`). +1. Open the iOS workspace you generated in [section 4](#4-generate-and-open-the-ios-workspace) (for example `ios/App/App.xcworkspace`). 2. In the Project Navigator, select the main **App** group (or the folder that contains the iOS app target sources). 3. Drag **`GoogleService-Info.plist`** from Finder into that group. 4. In the dialog: @@ -265,21 +280,6 @@ Before ngrok end-to-end testing, confirm: --- -## 5. Build and run the iOS app (physical device) - -From **crowd-funder-for-time-pwa**: - -```bash -npm install -npm run build:ios:dev # or build:ios:test — non-production for debug panel -``` - -Open the generated Xcode workspace, select your **physical iPhone**, enable signing, and Run. - -Ensure `VITE_FIREBASE_*` variables are set for the Capacitor build you use (see `.env` / build docs). Native push registration runs at startup via `initializeNativePushAndFirebaseMessaging()` in `main.capacitor.ts`. - ---- - ## 6. Configure the Notification Debug Panel backend override The app normally calls `APP_SERVER` (from `VITE_APP_SERVER`). For local wakeup testing, override the notification API base URL without rebuilding.