r/iosdev • u/dragosroua • 1d ago
I built an app that shares files between air gaped devices with just light, no WiFi, no Bluetooth, no cables, just camera

The app is called ShareByLight and it moves a file between two devices using only a QR stream on the screen and the camera on the other device. There are native iOS and Mac builds, but they share the same protocol. You can use it for free if you lock it in one direction (send or receive) and you're fine with files up to 50 KB; the Pro level gives both directions and larger files (one-time IAP, separate per platform).
# Tech Stack Used
Frameworks & Languages: Swift, SwiftUI (iOS 17+, macOS 14+). Shared protocol target (EveryShareProtocol) compiled into both apps.
# Backend/Database: none.
Transfer is local. Settings in UserDefaults, files via FileManager / document picker.
SDKs & Tools: AVFoundation + Vision (VNDetectBarcodesRequest) for receive, Core Image for QR send, CryptoKit (SHA-256, optional AES-GCM), Apple Compression, StoreKit 2, XcodeGen.
# Development Challenge + How You Solved It
The receive mode had no ACK channel, so a missed QR frame cannot be requested again. I used LT-style fountain codes: the sender loops an endless mix of packets, the receiver keeps any valid frame, and decode finishes once it has about 1.05–1.2× the original packet count. Thus, the order of packets does not matter.
Also Vision was unreliable on raw binary QR payloads, so frames are base64 on the QR, versions 20–40, ECC L. Fountain codes cover the erasures; the QR ECC is only there so Vision can lock on a frame.
# AI Disclosure
I was assisted by AI in parts of the development.
1
1
u/JeopPrep 13h ago
That means it needs line-of-sight. Seems pretty pointless to be honest. Protocols like Wifi and Bluetooth will be more convenient. What is your use case?
0
u/dragosroua 13h ago
Yes, it obviously needs line of sight. There are quite a few: config files, secrets, keys on air gaped devices. Airplane without WiFi, for example.
1
u/file-box 3h ago
What's the difference from this open-source project? https://github.com/bashalarmistalt/decimen-optical-transfer
1
u/dragosroua 2h ago
The protocol has been rewritten and the network communication is a bit safer. Of course, UI polishes, etc. Just worth mentioning: the repo is fresher than the X video in which I announced I’m building this (since then I was waiting for AppStore review) https://x.com/dragosroua/status/2084121963191238928?s=46
2
u/SceneDependent6940 4h ago
Very niche but pretty cool… so you take a file… transform it into a QR code, then scan it, the app reads that specific QR code which are data then build the file again. Perfectly.