Commit Graph

29 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
aba3c43227 fix(ios): render PiP frames — IOSurface-backed pixel buffers + DisplayImmediately
AVSampleBufferDisplayLayer only presents IOSurface-backed CVPixelBuffers; the
pool omitted kCVPixelBufferIOSurfacePropertiesKey, so frames were accepted
(status=.rendering, no error) but never rendered — the PiP window stayed black.
Add IOSurface backing and mark each sample buffer DisplayImmediately (no control
timebase, live HUD feed). Also wires the PiP Swift files into the Runner /
TrainerActivity Xcode targets (GearSnapshot in both; GearSnapshot+LiveActivity
in the extension only so Runner needs no ActivityKit).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 18:19:46 +02:00
Jonas Bark
120f80b9bb cleanup 2026-06-10 15:19:35 +02:00
Jonas Bark
891903a896 fix iOS build 2026-05-13 10:01:16 +02:00
Jonas Bark
350f60cde9 UI fixes 2026-05-13 09:45:09 +02:00
Jonas Bark
19ea3a9497 screenshots & iOS build 2026-05-13 09:30:13 +02:00
Jonas Bark
46100ad2a9 UI adjustments, add screenshot to support 2026-05-13 09:05:48 +02:00
Jonas Bark
38295262f9 build fix IOS 2026-05-13 08:02:16 +02:00
Jonas Bark
8bdca5f4a6 fix live activity 2026-05-09 16:00:31 +02:00
Jonas Bark
a2f50cf4e3 ios: move Embed Foundation Extensions before Thin Binary to break cycle
Earlier reorder put Embed Foundation Extensions last, which kept the
cycle: ProcessInfoPlistFile → appex (in PlugIns/) → [CP] Copy Pods
Resources → [CP] Embed Pods Frameworks → Thin Binary → Info.plist →
appex.

Putting Embed Foundation Extensions before Thin Binary linearises the
graph: the appex is in PlugIns/ before any later phase reads Info.plist
or runs the [CP] Pods scripts, so nothing later needs to wait on it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 10:39:56 +02:00
Jonas Bark
f4c5c5a00d ios: set APPINTENTS_DEPLOYMENT_POSTPROCESSING=NO at Runner target level
The xcconfig-level setting was not being honored by the Info.plist
processing step in Xcode 16, so the build cycle reappeared. Setting it
directly in all three Runner build configurations (Debug/Release/Profile)
in the pbxproj propagates to every step and breaks the cycle: with
AppIntents postprocessing off, ProcessInfoPlistFile no longer depends on
the embedded extension being copied first.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 10:31:20 +02:00
Jonas Bark
c847a10ed1 some fixes 2026-05-09 10:26:52 +02:00
Jonas Bark
cb15e4b0c6 ios: remove Info.plist input from Thin Binary phase to break extension cycle
Flutter's Thin Binary script phase declared TARGET_BUILD_DIR/INFOPLIST_PATH
as an input. Once the TrainerActivityExtension is embedded, Info.plist
becomes dependent on the extension being copied, and that dependency
loops back through the [CP] Pods phases to Thin Binary itself.

The script has alwaysOutOfDate = 1 (always runs) and uses xcode_backend.sh
embed_and_thin which reads Info.plist via env at runtime — no need for an
input declaration. Removing it breaks the cycle without changing behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 10:20:35 +02:00
Jonas Bark
47953a6cec new ui #17 2026-03-11 20:31:27 +01:00
Jonas Bark
865c37b328 UI adjustments 2026-02-27 12:33:18 +01:00
Jonas Bark
e1a7aac3e4 sign in with google, apple 2026-02-16 16:26:22 +01:00
Jonas Bark
e25429ee32 enable audio button capture on iOS 2026-02-14 10:11:25 +01:00
Jonas Bark
89016bffc3 windows #1 2025-12-14 19:54:41 +01:00
Jonas Bark
b69d41ecb5 in app purchase implementation on macOS / iOS 2025-12-14 19:32:23 +01:00
Jonas Bark
4af145c9a7 rebuild 2025-10-09 12:31:57 +02:00
Jonas Bark
3adc15e0a7 rebuild 2025-10-09 12:18:48 +02:00
Jonas Bark
678ad5d181 rebuild 2025-10-09 12:15:22 +02:00
Jonas Bark
8dd79a6651 rebuild 2025-10-09 12:02:42 +02:00
Jonas Bark
7b2a311799 make it work #6 2025-10-07 18:33:00 +02:00
Jonas Bark
a3883ab7dd try bluetooth_low_energy 2025-10-06 18:46:46 +02:00
Jonas Bark
872908a766 make connection work on iOS 2025-09-29 10:14:19 +02:00
Jonas Bark
734cde9152 Revert "remove iOS folder as Apple does not support the core functionality"
This reverts commit 6c69fbffba.
2025-09-29 09:54:43 +02:00
Jonas Bark
6c69fbffba remove iOS folder as Apple does not support the core functionality 2025-09-27 14:02:10 +02:00
Jonas Bark
793ed76100 initial commit 2025-03-26 15:41:06 +01:00