Commit Graph

28 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
081f4a113d feat(6.2): iOS screen recording backend (ReplayKit broadcast extension) [extension target needs Xcode wiring]
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 17:52:22 +02:00
Jonas Bark
120f80b9bb cleanup 2026-06-10 15:19:35 +02:00
Jonas Bark
c847a10ed1 some fixes 2026-05-09 10:26:52 +02:00
Jonas Bark
e5c3e6f0ef update iOS SDK 2026-04-29 09:42:58 +02:00
Jonas Bark
c5c945593d cleanup 2026-04-12 10:44:49 +02:00
Jonas Bark
b67f104ce0 enable shortcuts on iOS as well 2026-02-24 10:56:23 +01:00
Jonas Bark
e1a7aac3e4 sign in with google, apple 2026-02-16 16:26:22 +01:00
Jonas Bark
bd8c51d6ee iOS: keep app alive in background 2026-02-06 12:51:47 +01:00
Jonas Bark
dcf2748396 fix build 2026-01-22 15:40:23 +01:00
Jonas Bark
3a8b61f1d8 fix podfile 2025-12-26 20:35:59 +01:00
Jonas Bark
81cd068d45 implement logic 2025-12-26 19:36:20 +01:00
Jonas Bark
280ea274c8 implement functionality, refactoring 2025-12-18 11:37:21 +01:00
Jonas Bark
89016bffc3 windows #1 2025-12-14 19:54:41 +01:00
Jonas Bark
5cbf864604 work on mDNS 2025-12-05 11:14:16 +01:00
Jonas Bark
c4184a5bed screenshot adjustments 2025-12-01 18:14:16 +00:00
Jonas Bark
51a80d318f screenshot creation #1 2025-11-11 10:25:56 +01:00
Jonas Bark
b3a85b9b1f integrate media_key_detector package, add iOS implementation #1 2025-11-07 21:55:07 +01:00
Jonas Bark
8d0c4911f1 fix UI, fix first button click not handled 2025-10-27 16:44:37 +01:00
Jonas Bark
e0bddcd775 Bluetooth HID tests 2025-10-27 16:28:41 +01:00
Jonas Bark
0a8768079f refactor connection with remote and controllers 2025-10-27 11:12:23 +01:00
Jonas Bark
704c5995c9 revise restart mechanism, fix Android 'Exit' notification button issue 2025-10-17 09:41:33 +02:00
Jonas Bark
6756772a04 integrate shorebird 2025-10-12 11:05:13 +02:00
Jonas Bark
15723a9d4e - keep iOS app alive when in background
- keep app active on iOS to keep the remote control happy
- reconnect when this was ignored
2025-10-09 09:51:47 +02:00
Jonas Bark
182a110dda Revert "try flutter_ble_peripheral"
This reverts commit b9198f8b8d.
2025-10-06 19:28:43 +02:00
Jonas Bark
b9198f8b8d try flutter_ble_peripheral 2025-10-06 19:27:52 +02:00
Jonas Bark
a3883ab7dd try bluetooth_low_energy 2025-10-06 18:46:46 +02:00
Jonas Bark
79ff28ac57 some experiments for Click V2 2025-09-29 12:56:04 +02:00