Widget opens Maps via maps://; onboarding prompts after Continue; forced first fetch

- Widget tap-to-directions now uses the native maps:// scheme instead of
  http://maps.apple.com. The universal-link http URL failed to open from a
  widget and fell back to launching the containing app; maps:// opens
  Apple Maps directly for both small (whole widget) and medium (per row).
- Onboarding: removed the Skip button (mandatory flow), and system prompts
  (location, notifications, local network) now fire only when the user taps
  Continue/Allow on each page — not when the page appears. Pages
  auto-advance once a permission is granted.
- After 'Start Using FuelBoard' the first data fetch is forced, so a
  reinstall that leaves a recent lastRefresh in app-group defaults can no
  longer skip the fetch and leave the station list empty. 35 tests pass.
This commit is contained in:
FuelBoard Contributor
2026-08-12 12:41:19 +01:00
parent 2a8de27571
commit 9ce0c83d66
4 changed files with 38 additions and 26 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import AppIntents
// FuelBoard widget petrol stations near you.
// systemMedium: top 3-4 stations with price + distance, each row opens Maps
// systemSmall: single station, whole widget opens Maps
// Taps deep-link to Apple Maps directions (http://maps.apple.com/?daddr=).
// Taps deep-link to Apple Maps directions (maps://?daddr=).
// Note: on the home screen Link opens Maps directly. Inside CarPlay the widget
// renders but can't launch Maps (widgets can only launch their own CarPlay app).
//
@@ -261,7 +261,7 @@ struct FuelPriceWidgetView: View {
.foregroundStyle(.secondary)
}
ForEach(entry.stations.prefix(3)) { station in
Link(destination: station.mapsDirectionsURL ?? URL(string: "http://maps.apple.com")!) {
Link(destination: station.mapsDirectionsURL ?? URL(string: "maps://")!) {
HStack(spacing: 8) {
Text(station.brand.sanitizedStationTitle)
.font(.caption.weight(.semibold))