Widget tap relay via fuelboard:// scheme; full station names; no check-again

- WidgetKit widgets can only open their containing app — the Link URL is
  delivered to FuelBoard via onOpenURL, never opened directly in Maps. The
  widget now links to a registered fuelboard://directions?lat=&lng= URL,
  and FuelBoardApp forwards it to native maps://?daddr= directions.
  (http://maps.apple.com and raw maps:// both silently dropped in-app.)
- Widget rows (small + medium) now show the full station name (station.name)
  instead of just the brand.
- Onboarding network page: removed the 'Check again' secondary screen after
  the Local Network prompt — Open Settings remains the only retry path.
  35 tests pass.
This commit is contained in:
FuelBoard Contributor
2026-08-12 12:54:08 +01:00
parent 9ce0c83d66
commit 1ff14607c5
5 changed files with 42 additions and 13 deletions
+11 -4
View File
@@ -153,14 +153,21 @@ struct FuelStation: Identifiable, Codable, Equatable {
return r * 2 * atan2(sqrt(a), sqrt(1 - a))
}
/// Apple Maps directions URL used by the widget tap and app rows.
/// Uses the native `maps://` scheme (not `http://maps.apple.com`), which
/// opens Maps directly; universal-link http URLs fall back to opening the
/// containing app when tapped from a widget.
/// Apple Maps directions URL used by the app's rows/notifications, which
/// open it directly via `UIApplication.shared.open`.
var mapsDirectionsURL: URL? {
URL(string: "maps://?daddr=\(lat),\(lng)&t=d")
}
/// Widget tap URL. WidgetKit widgets can ONLY open their containing app:
/// the system hands this URL to FuelBoard via `onOpenURL`, which then
/// forwards to Apple Maps. So the widget link uses our own registered
/// `fuelboard://` scheme rather than `maps://` (which would arrive in the
/// app and be silently dropped).
var widgetDirectionsURL: URL? {
URL(string: "fuelboard://directions?lat=\(lat)&lng=\(lng)")
}
/// Name of the bundled brand logo asset, or nil if unknown.
/// Normalizes messy raw brand strings ("SHELL LEEDS ROAD" "shell").
var brandImageName: String? {