[mobile-ios] iOS: sync plugins from #35, ATS local networking, testnet build env

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 00:03:36 -05:00
co-authored by Claude Opus 5.5
parent 337ac4be77
commit 41f4bfb39f
4 changed files with 21 additions and 3 deletions
+6 -1
View File
@@ -70,7 +70,12 @@ Note: the VNC keyboard via `vncdotool` drops Shift (everything types lowercase,
Capacitor **7** to match Android (Node 20 on inspiron).
- **Swift Package Manager**, not CocoaPods: `ios/App/CapApp-SPM/Package.swift` is managed by `npx cap sync`; Xcode
resolves `capacitor-swift-pm` itself. No Ruby/CocoaPods needed in the VM.
- **Node URL:** build-time `VITE_NODE_URL` (defaults to the testnet), same as Android.
- **Testnet build:** `build-sim.sh` sets the same defaults as `android/build-debug.sh`: `VITE_WIKIDECK_NETWORK=testnet`,
`VITE_WIKIDECK_GENESIS_TIME=1792411200`, `VITE_NODE_URL=http://192.168.1.32:3101` (override via env).
- **Plain HTTP to the LAN node:** `Info.plist` sets `NSAppTransportSecurity` → `NSAllowsLocalNetworking` (local/IP hosts
only, not arbitrary HTTP), because iOS ATS blocks cleartext by default. From the VM's simulator, 192.168.1.32 is reached
through QEMU's user-mode NAT on inspiron.
- **Plugins:** `@capacitor/app` and `@capacitor/browser` (from #35) are wired into `CapApp-SPM/Package.swift`.
- **Origin check:** mobile-android routes native requests through `CapacitorHttp`, which sends no `Origin` header, so
`server/testnet/http.ts` needs no change. Without it, the iOS WebView origin would be `capacitor://localhost`.
- **SSO (#7):** `Info.plist` registers the `dev.eom.wikideck` URL scheme; redirect `dev.eom.wikideck:/oauth/callback`
+5
View File
@@ -58,5 +58,10 @@
</array>
</dict>
</array>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
</dict>
</plist>
+6 -2
View File
@@ -11,14 +11,18 @@ let package = Package(
targets: ["CapApp-SPM"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "7.6.10"),
.package(name: "CapacitorApp", path: "../../../node_modules/@capacitor/app"),
.package(name: "CapacitorBrowser", path: "../../../node_modules/@capacitor/browser")
],
targets: [
.target(
name: "CapApp-SPM",
dependencies: [
.product(name: "Capacitor", package: "capacitor-swift-pm"),
.product(name: "Cordova", package: "capacitor-swift-pm")
.product(name: "Cordova", package: "capacitor-swift-pm"),
.product(name: "CapacitorApp", package: "CapacitorApp"),
.product(name: "CapacitorBrowser", package: "CapacitorBrowser")
]
)
]
+4
View File
@@ -13,6 +13,10 @@ sudo xcodebuild -license accept 2>/dev/null || true
xcodebuild -runFirstLaunch >/dev/null 2>&1 || true
npm ci
# Same testnet build settings as android/build-debug.sh (otherwise the app shows MAINNET).
export VITE_WIKIDECK_NETWORK="${VITE_WIKIDECK_NETWORK:-testnet}"
export VITE_WIKIDECK_GENESIS_TIME="${VITE_WIKIDECK_GENESIS_TIME:-1792411200}"
export VITE_NODE_URL="${VITE_NODE_URL:-http://192.168.1.32:3101}"
npm run build
npx cap sync ios