Repository navigation
Description
Written for the iOS side of the project. I have no Mac, so I could not build or test any iOS change. Everything below on the iPhone side is a proposal, not tested code.
The gap
Today clipboard sync PC → phone only works while the app is in the foreground: handleScenePhase(.background) closes the connection (suspendForBackground()), and the app declares no UIBackgroundModes. A copy made while the phone is locked is lost (a separate change catches the missed copy up when the app is opened, but not before).
iOS does keep an app alive in the background for a Bluetooth accessory (bluetooth-central), and Tether already talks to tetherd over Bluetooth (BluetoothDiscovery.swift). So the natural path is a GATT subscription.
What the daemon can offer (implemented, on a branch, not proposed as a PR yet)
Service BA7A69F7-BF0F-4C09-8C73-CF4EE9AFB5B5 (already read by BluetoothDiscovery), two new characteristics, encrypt-read:
…B7announce,notify:{"v":1,"seq":N,"size":S,"trunc":false}on every clipboard change…B8text,read: the clipboard as UTF-8 (≤ 512 bytes, cut on a character boundary)
Verified with nRF Connect on an iPhone: subscribe to …B7, copy on the computer, notification within a second, read …B8.
What the iOS app would need (proposal)
UIBackgroundModes: [bluetooth-central]in Info.plist.- A long-lived
CBCentralManagerwith a restore identifier (CBCentralManagerOptionRestoreIdentifier) andcentralManager(_:willRestoreState:), so iOS can relaunch the app for BLE events. - On connect to the bonded Mac/PC peripheral: discover the service,
setNotifyValue(true)on…B7. - On a notification: read
…B8, and write the string toUIPasteboard.generalwhenclipboard auto-syncis on (same path as the existingclipboard_updatedhandler). Useseqto ignore repeats; iftruncis true, keep the short text (the TCP path can fetch the rest when the app is opened). - Setting to turn it off.
Caveats worth deciding on: writing the pasteboard from the background should be allowed (reads are the restricted direction) but I could not test it; and the phone → computer direction cannot be made automatic for the reason below.
Phone → computer
iOS gives apps no pasteboard-change event and no background pasteboard reads, so this cannot be automatic. The closest is a one-gesture action that works without opening the app: an App Intent "Send clipboard to computer" (reads the pasteboard while running as an intent, sends clipboard_set), which people can bind to Back Tap, the Action Button or Control Center. The existing share extension covers selected text and images today.
Offer
The daemon half is implemented and tested with a generic GATT client: https://github.com/fernando2393/tether/tree/pr/ble-clipboard-push (one commit on top of main). I held it back as a PR because nothing in the iOS app uses it yet; if you would like this direction I will open it, and I am happy to review or test the iOS change on a real device.
🤖 Generated with Claude Code
Related changes I opened from the same work: #337 (X11/XWayland clipboard backend), #338 (catch up a reconnecting phone), #339 (notification resilience across LE blips).
Activity
fernando2393 commentedon Nov 25, 2026
The same wake-up would solve file sends. Right now a file sent from the desktop (Tether's window, or Dolphin's menu) only arrives while the app is open, since the app has no background mode.
Proposal: use the Bluetooth link only as a doorbell. The desktop notifies a characteristic (the branch linked above already has the desktop side for the clipboard); with
bluetooth-centralinUIBackgroundModesand state restoration, iOS wakes the app in the background, it connects over the existing mTLS Wi-Fi channel and pulls what's waiting (a clipboard, a file), then posts a local notification like "photo.jpg received". Data over Wi-Fi keeps it fast; Bluetooth LE alone would be far too slow for files. iOS gives a few seconds per wake, extendable with a background task, which covers typical files on a LAN.I can't build or test iOS here, so this one would need you on the app side. Happy to do the daemon half if it sounds right.