background sync

This commit is contained in:
2025-10-19 20:26:40 +02:00
parent 8bb48daf6c
commit eeedc629d7
5 changed files with 119 additions and 31 deletions

View File

@@ -22,8 +22,8 @@ This SwiftUI app connects to the Cardboy device over Bluetooth Low Energy and up
## Usage
1. Open `cardboy-companion/cardboy-companion.xcodeproj` in Xcode.
2. Enable the `CoreBluetooth` capability for the `cardboy-companion` target (Signing & Capabilities tab).
2. Ensure the `CoreBluetooth` capability is enabled for the `cardboy-companion` target and keep the *Uses Bluetooth LE accessories* background mode on (preconfigured in this project).
3. Build & run on a real device (BLE is not available in the simulator).
4. Allow Bluetooth permissions when prompted, then tap **Sync Now**.
4. Allow Bluetooth permissions when prompted. The app keeps scanning in the background, so the Cardboy can request a sync even while the companion is not foregrounded. Tap **Sync Now** any time you want to trigger a manual refresh.
Optionally bundle this code into your existing app—`TimeSyncManager` is selfcontained and can be reused.