AllSpark Edge mobile app for iOS. This app provides real-time video capture, recording, and uploading capabilities with face detection and blurring features.
Important
AllSpark Edge consists of this iOS client and the AllSpark Edge Server. For compatibility reasons, please ensure that you run release versions of both repositories that share at least the same minor semantic version tag (e.g., v0.3.x of the iOS app with v0.3.x of the server).
- Camera Capture: Real-time video capture from front or back camera
- Face Detection & Blurring: Automatic detection and pixelation of faces using Vision framework
- Continuous Recording: Automatically records video in chunks (default 30s) when camera view is active
- Storage Management: Automatically manages device storage by deleting oldest recordings when limit is reached
- Auto-Discovery: Automatically discovers available servers on the local network using Bonjour/mDNS
- Time-Range Upload: Server can request upload of video segments for specific time ranges
- Video Format Selection: Choose between MP4 (default) or MOV format for recordings
- Network Configuration: Configurable server host with support for discovered services
- CameraViewController: Handles camera capture, face detection, continuous video recording, and user interaction
- ConnectionManager: Singleton managing WebSocket connections, Bonjour service discovery, and video uploads
- SettingsView: Network configuration, server discovery list, and connection diagnostics
- WebSocket Protocol: Two-phase upload (metadata → binary data) & JSON command interface
The iOS app establishes HTTP and WebSocket connections to a configured server for real-time video upload and command reception.
For complete documentation on the expected WebSocket message protocol, JSON command interfaces, and HTTP endpoints, please see the Endpoints Documentation in the AllSpark Edge Server repository.
Located in SettingsView.swift, allows users to:
-
Configure Device Name (optional)
- Custom name shown on server's web interface
- Useful for identifying specific devices in the test host
- Defaults to the iOS device name (e.g., "iPhone")
-
Configure Server Host
- Auto-Discovery: Automatically updates with server found on local network (Bonjour/mDNS)
- Manual Entry: Allows manual IP/Hostname entry if server is not discovered, edits will automatically attempt to connect to WebSocket
- Default:
localhost:8080 - Supports: IP addresses, hostnames, with or without protocol prefix
-
Configure Server Discovery
- Auto-Discovery: Automatically lists servers using
_allspark._tcpfound on local network (Bonjour/mDNS) - Manual Discovery: Allows manual selection of discovered servers to connect to
- Auto-Discovery: Automatically lists servers using
-
Set SSL Verfification
- Default:
true - If testing self-signed certificates, set to
false
- Default:
-
Control/Monitor WebSocket Connection Manual Connection: When
Disconnectedallows WebSocket connection attempts Manual Disconnection: WhenConnectedallows WebSocket disconnection- Displays connection status (success/failure)
- Shows connection protocol (ws:// or wss://) being used
- Useful for diagnosing network or certificate issues
-
Edit Permissions
- Opens Allspark's iOS app permissions settings
- Local Network: May be required for WebSocket/HTTP connections depending on server configuration
- Microphone: Required for audio recording
- Camera: Required for video recording
The Camera tab displays a WiFi icon in the top-right corner that indicates connection status:
- Red WiFi with slash - Disconnected from server
- Orange WiFi - Attempting to connect
- Green WiFi - Connected to server
- Green WiFi + Green Lock - Connected via secure WSS protocol
The lock icon overlay appears automatically when using a secure WebSocket (WSS) connection, indicating encrypted communication with the server.
When a previously established server connection becomes unavailable:
- Automatic Detection: The app detects connection loss when WebSocket receive errors occur after successful connection
- UI Update: The connection icon immediately changes from green to red
- User Alert: A modal alert notifies the user that the server was lost with two options:
- Reconnect: Manually initiate reconnection attempt
- Dismiss: Close the alert
- Automatic Recovery: The app automatically attempts to reconnect after 5 seconds, allowing the connection to be restored if the server comes back online
- Continuous Attempts: Automatic reconnection attempts continue until the connection is restored or the user navigates away from the camera view
The app operates on a "always-recording" model when the Camera view is active:
- View Appears: Camera initializes and recording starts immediately.
- Chunking: Video is recorded in chunks (default 30 seconds) defined by
videoChunkDurationMs. - Storage: Files are saved locally to the device.
- Cleanup: Oldest files are automatically deleted when total storage exceeds
videoBufferMaxMB. - Upload: Files are NOT uploaded automatically. They are only uploaded when:
- User explicitly taps "Upload" button
- Server sends an
uploadTimeRangecommand matching the file's time range
This ensures a buffer of recent video is always available for on-demand retrieval without saturating network bandwidth.
Icons used are sourced internally in iOS from SF Symbols Online from a repository like this one: https://github.com/andrewtavis/sf-symbols-online.
- Video recordings are stored in Documents directory
- Both MP4 and MOV formats require decoder support on the receiving server
- Face detection performance depends on device capabilities and lighting conditions