Commit Graph

21 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
1ce9ab43c0 fix scanner 2026-06-10 07:23:36 +02:00
Jonas Bark
5b94740220 macOS login 2026-02-16 17:17:52 +01:00
Jonas Bark
7fac3390b1 update dependencies 2026-01-19 11:01:42 +01:00
Jonas Bark
b69d41ecb5 in app purchase implementation on macOS / iOS 2025-12-14 19:32:23 +01:00
Jonas Bark
5dcab76fdc more name change work 2025-11-23 08:08:03 +00:00
Jonas Bark
58411e8b23 macos + ios icon changes 2025-10-17 09:19:21 +02:00
Jonas Bark
b939c36863 new icon, cleanup 2025-10-16 23:46:32 +02:00
Jonas Bark
f7487db5e8 initial fixes 2025-10-09 22:37:07 +02:00
Jonas Bark
d99090dc79 rebuild 2025-10-09 15:55:15 +02:00
Jonas Bark
d3f0616745 rebuild 2025-10-09 15:06:38 +02:00
Jonas Bark
25d19e3df9 rebuild 2025-10-09 13:25:28 +02:00
Jonas Bark
8dd79a6651 rebuild 2025-10-09 12:02:42 +02:00
Jonas Bark
1ac311ed76 make macOS work #7 2025-10-07 20:42:12 +02:00
Jonas Bark
0fe86c2c1b make macOS work #7 2025-10-07 20:08:46 +02:00
Jonas Bark
db24051651 update some libraries to ensure compatibility with latest Flutter 2025-09-08 15:49:31 +02:00
Jonas Bark
3a41fbdadd try to sign macOS app 2025-03-28 16:43:47 +01:00
Jonas Bark
9172642b6b try to notarize macOS app 2025-03-28 16:16:49 +01:00
Jonas Bark
6154f59015 web fixes, logo, github actions 2025-03-28 12:31:04 +01:00
Jonas Bark
4071473e45 works on macOS, Web and Android 2025-03-26 19:39:00 +01:00
Jonas Bark
793ed76100 initial commit 2025-03-26 15:41:06 +01:00