Files
swiftcontrol/ios/Podfile.lock
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

84 lines
3.1 KiB
Plaintext

PODS:
- Flutter (1.0.0)
- flutter_foreground_task (0.0.1):
- Flutter
- flutter_screen_recording (0.0.1):
- Flutter
- flutter_volume_controller (0.0.1):
- Flutter
- gamepads_ios (0.1.1):
- Flutter
- local_network_permission (1.0.0):
- Flutter
- FlutterMacOS
- media_key_detector_ios (0.0.1):
- Flutter
- nsd_ios (0.0.1):
- Flutter
- permission_handler_apple (9.3.0):
- Flutter
- restart_app (0.0.1):
- Flutter
- screen_recorder (0.0.1):
- Flutter
- sign_in_with_apple (0.0.1):
- Flutter
DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_foreground_task (from `.symlinks/plugins/flutter_foreground_task/ios`)
- flutter_screen_recording (from `.symlinks/plugins/flutter_screen_recording/ios`)
- flutter_volume_controller (from `.symlinks/plugins/flutter_volume_controller/ios`)
- gamepads_ios (from `.symlinks/plugins/gamepads_ios/ios`)
- local_network_permission (from `.symlinks/plugins/local_network_permission/darwin`)
- media_key_detector_ios (from `.symlinks/plugins/media_key_detector_ios/ios`)
- nsd_ios (from `.symlinks/plugins/nsd_ios/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- restart_app (from `.symlinks/plugins/restart_app/ios`)
- screen_recorder (from `.symlinks/plugins/screen_recorder/ios`)
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_foreground_task:
:path: ".symlinks/plugins/flutter_foreground_task/ios"
flutter_screen_recording:
:path: ".symlinks/plugins/flutter_screen_recording/ios"
flutter_volume_controller:
:path: ".symlinks/plugins/flutter_volume_controller/ios"
gamepads_ios:
:path: ".symlinks/plugins/gamepads_ios/ios"
local_network_permission:
:path: ".symlinks/plugins/local_network_permission/darwin"
media_key_detector_ios:
:path: ".symlinks/plugins/media_key_detector_ios/ios"
nsd_ios:
:path: ".symlinks/plugins/nsd_ios/ios"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
restart_app:
:path: ".symlinks/plugins/restart_app/ios"
screen_recorder:
:path: ".symlinks/plugins/screen_recorder/ios"
sign_in_with_apple:
:path: ".symlinks/plugins/sign_in_with_apple/ios"
SPEC CHECKSUMS:
Flutter: 71a624a5bc0c04062bf19101d501e466baf2fb47
flutter_foreground_task: a159d2c2173b33699ddb3e6c2a067045d7cebb89
flutter_screen_recording: d27b9073d122b618a07ef0e407470d051b265b26
flutter_volume_controller: c2be490cb0487e8b88d0d9fc2b7e1c139a4ebccb
gamepads_ios: c75c6d31377d275b0effb9174c619e2705678c09
local_network_permission: 888f0fc169e820dff9137aa77b69fd4624485979
media_key_detector_ios: eb43ab957d4ef9084d079216b6dbac96c91d42eb
nsd_ios: 596ad79109ddd3e52d665f650f36428049e3653e
permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d
restart_app: 9cda5378aacc5000e3f66ee76a9201534e7d3ecf
screen_recorder: 192d2308d545ace5676318ff0c1f2ee53231dbc1
sign_in_with_apple: c5dcc141574c8c54d5ac99dd2163c0c72ad22418
PODFILE CHECKSUM: 7ebd5c9b932b3af79d5c67e3af873118b74e970f
COCOAPODS: 1.17.0