Overview
The FERAL Node iOS app turns your iPhone into a FERAL edge node. It forwards HealthKit data, camera frames, voice audio, and location to your Brain, and receives orchestrated responses back.Requirements
- iOS 16+
- Xcode 15+
- A running FERAL Brain (local or remote)
Setup
- Open
feral-nodes/ios-app/in Xcode. - Select your development team in Signing & Capabilities.
- Build and run on a device (camera/BLE require a physical device).
QR Pairing
The fastest way to connect is via QR code:- On the Brain dashboard, click Add Device → QR Code.
- In the iOS app, go to Settings → Scan QR.
- Point the camera at the QR code.
Permission Requests
The app requests the following permissions (configured inInfo.plist):
| Permission | Key | Purpose |
|---|---|---|
| Camera | NSCameraUsageDescription | QR scanning and perception pipeline |
| Microphone | NSMicrophoneUsageDescription | Voice commands |
| Location | NSLocationWhenInUseUsageDescription | Context-aware assistance |
| HealthKit | NSHealthShareUsageDescription | Health monitoring (HR, SpO2, steps, sleep) |
| Bluetooth | NSBluetoothAlwaysUsageDescription | FERAL Glasses sensor data |
TLS Pinning
For production deployments, pin the Brain’s TLS certificate:- Get the SHA-256 hash of your server’s DER certificate:
- Set the
FERAL_BRAIN_CERT_HASHenvironment variable (or Xcode scheme env) to the hash. - The app will reject connections to servers with a different certificate.
FERAL_BRAIN_CERT_HASH is not set, the app trusts system CAs and logs a warning.
Running Tests
- ConnectionManagerTests — QR parsing, connection state, URL construction
- HealthKitManagerTests — HK type validation, unit conversions, payload format
- QRScannerTests — both JSON and
feral://protocol parsing
Troubleshooting
- “Not connected” — Verify the Brain host is reachable from the phone’s network.
- HealthKit empty — Grant HealthKit permissions in Settings → Privacy → Health.
- QR scan fails — Ensure the QR contains valid JSON with
host,port,apiKey,nodeName. - TLS errors — Double-check
FERAL_BRAIN_CERT_HASHmatches your server cert.
