Files
swiftapp/README.md
Jürgen Kunz a6939453f8
Some checks failed
CI / test (push) Has been cancelled
Adopt root-level tsswift app layout
Move the app payload under swift/ while keeping git, package.json, and .smartconfig.json at the repo root. This standardizes the Swift app setup so build, test, run, and watch workflows match the other repos.
2026-04-19 01:21:43 +02:00

71 lines
2.6 KiB
Markdown

# idp.global Swift App
Multiplatform SwiftUI scaffold for the personal `idp.global` companion app on iPhone, iPad, Mac, and Apple Watch.
## Included in this first pass
- QR and NFC-based device pairing flows with a seeded preview payload fallback
- NFC authentication now attaches a signed GPS position on supported iPhone hardware
- Mocked approval inbox for accepting or rejecting identity requests
- Notification center with local notification permission flow and a test notification trigger
- Apple Watch companion target with a compact approval-first dashboard and request detail flow
- Shared app state and mock backend boundary so a real API can be connected later
## Open the project
1. Open `swift/IDPGlobal.xcodeproj`.
2. Build the `IDPGlobal` scheme for:
- `My Mac`
- an iPad simulator
- an iPhone simulator
3. Build the `IDPGlobalWatch` scheme for an Apple Watch simulator when you want to verify the companion experience.
## tsswift workflow
From the repo root:
```bash
corepack pnpm install
corepack pnpm swift:doctor
corepack pnpm swift:emulators
corepack pnpm swift:build
corepack pnpm swift:test
corepack pnpm swift:run
corepack pnpm swift:watch
```
This repo now follows the same layout as the other Swift app repos:
- git root at the repo root
- root `package.json`
- root `.smartconfig.json`
- Swift app content under `swift/`
Current `tsswift` behavior here:
- `build` targets macOS, iPhone Simulator, and iPad Simulator in parallel
- `test` targets macOS
- `run` defaults to macOS unless you pass `--platform ios` or `--platform ipad`
- `watch` rebuilds and relaunches macOS, iPhone, and iPad app instances on file changes
The Apple Watch companion is still part of the Xcode project, but `tsswift` is currently configured around the main `IDPGlobal` app targets only.
## Mock QR payload
The app seeds this pairing payload on first launch:
`idp.global://pair?token=swiftapp-demo-berlin&origin=code.foss.global&device=Safari%20on%20Berlin%20MBP`
You can paste it manually, scan it as a QR code, or use the preview pairing action while the backend is still mocked.
For NFC authentication, the app reads the pairing payload from the tag, captures the current device location, signs that GPS position, and submits both together.
## Next integration step
Replace `MockIDPService` with a live service that:
- exchanges the pairing payload and signed NFC location proof for a session token
- loads approval requests and notifications from the backend
- posts approval decisions back to `idp.global`
- syncs session and request state between iPhone and Apple Watch, likely through a shared backend session or WatchConnectivity bridge