forked from WikiDeck/wikideck
[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:
+6
-1
@@ -70,7 +70,12 @@ Note: the VNC keyboard via `vncdotool` drops Shift (everything types lowercase,
|
|||||||
Capacitor **7** to match Android (Node 20 on inspiron).
|
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
|
- **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.
|
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
|
- **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`.
|
`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`
|
- **SSO (#7):** `Info.plist` registers the `dev.eom.wikideck` URL scheme; redirect `dev.eom.wikideck:/oauth/callback`
|
||||||
|
|||||||
@@ -58,5 +58,10 @@
|
|||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
|
<key>NSAppTransportSecurity</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSAllowsLocalNetworking</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -11,14 +11,18 @@ let package = Package(
|
|||||||
targets: ["CapApp-SPM"])
|
targets: ["CapApp-SPM"])
|
||||||
],
|
],
|
||||||
dependencies: [
|
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: [
|
targets: [
|
||||||
.target(
|
.target(
|
||||||
name: "CapApp-SPM",
|
name: "CapApp-SPM",
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
.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")
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ sudo xcodebuild -license accept 2>/dev/null || true
|
|||||||
xcodebuild -runFirstLaunch >/dev/null 2>&1 || true
|
xcodebuild -runFirstLaunch >/dev/null 2>&1 || true
|
||||||
|
|
||||||
npm ci
|
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
|
npm run build
|
||||||
npx cap sync ios
|
npx cap sync ios
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user