Commit Graph

149 Commits

Author SHA1 Message Date
Jonas Bark
905c2641cd feat(ios/macos): detect the Local Network permission instead of failing silently
Denial of Apple's Local Network privacy permission is the most common cause of
"BikeControl can't see my trainer app" on iOS and macOS, and it fails
completely silently: Bonjour browses return nothing forever, advertisements
never leave the device, nothing throws. An app watching only for errors cannot
tell "permission is off" from "there is nothing out there".

Apple ships no authorization-status API for it (not iOS 14...26, not macOS
15...26), so the new local_network_permission plugin measures it: an NWListener
and an NWBrowser on _bikecontrol-preflight._tcp, then

  browser discovers the listener        -> granted
  kDNSServiceErr_PolicyDenied (-65570)  -> denied
  neither, before the deadline          -> unknown

unknown is a real outcome, not an error — a device with no usable network never
completes the round trip even when the permission is fine — so everything fails
open on it and only a positive denial blocks the user.

The probe *is* the request: the system prompt fires on the first Bonjour
operation, so there is no separate request step, and after the user answers,
System Settings is the only way back.

- LocalNetworkAccess caches the result (probes cost a real round trip while
  getStatus() runs on every tile mount, tap and resume) and collapses
  concurrent probes into one, since two listeners on the same service type
  would resolve each other.
- LocalNetworkRequirement gates the three LAN tiles: MyWhoosh Link, Zwift mDNS
  and OpenBikeControl mDNS. Suppressed in screenshot/demo mode like the rest.
- Diagnostics drop the old guess (inferred from whether a discovery scan
  returned anything, which could not tell denied from an empty LAN) for the
  measured local-network=granted|denied|unknown.
- _bikecontrol-preflight._tcp added to NSBonjourServices on both platforms;
  without it the browse fails for a reason unrelated to the permission.

The Xcode project deployment-target bumps (ios 13.0->15.0, macos 10.15->12.0)
are Flutter's own migration aligning project defaults with the Podfiles; they
happen on any first build.

Verified with real builds on both platforms, not just analysis: flutter build
macos --debug and flutter build ios --no-codesign both succeed, the framework
is linked in, and the preflight service type is present in both built
Info.plists. 35 tests cover the mapping, cache, concurrency and fail-open
behaviour.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 07:58:18 +02:00
Jonas Bark
c4ebf432ee BLE permission 2026-07-10 12:17:40 +02:00
Jonas Bark
6b49eed044 iOS: fix bluetooth permission 2026-06-19 13:24:22 +02:00
Jonas Bark
29741e520f migrate peripheral mode to universal_ble 2.0.0
Drop bluetooth_low_energy. Move OBC BLE emulator, Zwift emulator, and
the remote mouse / keyboard pairing flows onto a new PeripheralServer
wrapper around UniversalBlePeripheral that routes per-characteristic
read/write handlers, so multiple peripheral instances coexist without
clobbering universal_ble's process-wide handlers.

Also: onValueChange callback gains a timestamp param (v1.0.0 breaking
change), PeripheralManager().showAppSettings() → openAppSettings(),
UUID.short(0x12) → literal UUID, and prop submodule bumped to the
matching universal_ble peripheral rewrite.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 09:28:39 +02:00
Jonas Bark
b62c8a5fc5 cleanup, dircon fixes 2026-04-10 16:02:59 +02:00
Jonas Bark
727efe9a61 fix late init issue 2026-04-04 09:22:27 +02:00
Jonas Bark
ab5a712c9e revise connection methods 2026-03-25 09:27:48 +01:00
Jonas Bark
a34b2ac9bf revise connection methods 2026-03-25 09:27:37 +01:00
Jonas Bark
7681abc5a9 revise logic 2026-03-06 18:18:23 +01:00
Jonas Bark
0ecd604f57 no longer build self signed MSIX 2026-03-06 18:12:09 +01:00
jonas.bark@gmx.de
b9478b1bd2 Windows login 2026-02-16 17:14:38 +01:00
Jonas Bark
6473b59ee5 cleanup toast handling 2026-02-08 10:01:54 +01:00
Jonas Bark
083efe4907 cleanup streams on exit 2026-02-01 10:08:31 +01:00
Jonas Bark
4449b57492 add OpenBikeControl protocol to onboarding 2026-01-19 08:23:30 +01:00
Jonas Bark
5f246023f0 change notification icon 2026-01-16 12:59:39 +01:00
Jonas Bark
6f3142c913 fix detection for hardware buttons when BikeControl is in foreground, change notification icon 2026-01-16 12:38:10 +01:00
Jonas Bark
279f6c8a06 fix issue #258 2026-01-16 00:20:30 +01:00
Jonas Bark
c192743ce9 make notifications optional on macOS & iOS 2026-01-03 09:42:03 +01:00
Jonas Bark
86216d4738 onboarding UI 2026-01-01 13:44:45 +01:00
jonas.bark@gmx.de
7c2a9e2b23 fix windows notifications 2025-12-30 13:19:56 +01:00
Jonas Bark
a73448bec3 message permission fix 2025-12-29 15:08:46 +01:00
Jonas Bark
6a56758173 improve Android notification action handling 2025-12-22 11:13:37 +01:00
Jonas Bark
8c4f40eba5 version++ 2025-12-19 10:09:06 +01:00
Jonas Bark
22383b5e6b macOS fix 2025-12-17 11:13:42 +01:00
Jonas Bark
332f4bf8a9 show connection update notifications 2025-12-17 10:54:16 +01:00
Jonas Bark
ae5503a6c6 notifications on iOS 2025-12-17 10:20:36 +01:00
Jonas Bark
d9a3851cee limit to 80 on Android during trial period, only count sent out commands 2025-12-17 10:02:32 +01:00
Jonas Bark
2528342a7b remove remains of swift_control 2025-12-14 16:22:07 +01:00
Jonas Bark
fa43294b3f better web compatibility 2025-12-07 12:05:52 +01:00
Jonas Bark
e58721d0ee refactoring 2025-12-06 11:46:18 +01:00
Jonas Bark
02d21a01b8 ui adjustments, fixes 2025-12-06 10:02:56 +01:00
Jonas Bark
09f3c5f0b8 cleanup, refactoring 2025-12-05 15:40:04 +01:00
Jonas Bark
cbe995ec52 cleanup, refactoring 2025-12-05 13:22:52 +01:00
Jonas Bark
5bf9c4df63 work on mDNS 2025-12-05 10:51:40 +01:00
Jonas Bark
ed5b854def ui, fixes 2025-12-04 20:59:07 +00:00
Jonas Bark
de70c80ca7 ui, fixes 2025-12-04 20:00:01 +00:00
Jonas Bark
58998bb61b ui, fixes 2025-12-04 19:32:02 +00:00
Jonas Bark
eea1e5007e connection method badges 2025-12-04 14:00:39 +00:00
Jonas Bark
7e08d3687b add openbikecontrol as app 2025-12-04 13:27:40 +00:00
Jonas Bark
04cfd68140 translations 2025-12-01 15:46:02 +00:00
copilot-swe-agent[bot]
d40a44c16d Add i18n_extension.dart and fix import/export keys, update imports
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2025-12-01 14:48:45 +00:00
copilot-swe-agent[bot]
ac6b430172 Update remaining files to use localized strings
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2025-12-01 14:41:28 +00:00
copilot-swe-agent[bot]
68aaaa083b Update widgets and utils to use localized strings
Co-authored-by: jonasbark <1151304+jonasbark@users.noreply.github.com>
2025-12-01 14:35:11 +00:00
Jonas Bark
6b5ad1d9ce wording 2025-12-01 13:40:00 +00:00
Jonas Bark
19d1fc7563 toast changes 2025-12-01 12:02:41 +00:00
Jonas Bark
72e63e3a5e UI changes, cleanup 2025-12-01 10:57:23 +00:00
Jonas Bark
5bf82b9d3d auto start connection methods and scanning 2025-12-01 09:30:21 +00:00
Jonas Bark
456e7cd45d heureka 2025-11-30 00:44:45 +00:00
Jonas Bark
623a98bf76 openbikeprotocol Bluetooth emulator 2025-11-29 17:46:12 +00:00
Jonas Bark
92a219cf4a openbikeprotocol Bluetooth emulator 2025-11-29 17:10:23 +00:00