1.1: Home-Screen-Widget + Siri-Kurzbefehl „Gassi gehen"
App Group group.app.banyaro.ios verbindet App und Widget-Extension (Entitlements in beiden Targets, CODE_SIGN_ENTITLEMENTS fürs Widget). Home-Screen-Widget (D): - BanYaroHomeWidget (klein + mittel): Tagesfoto, Hundename, nächster Termin. - App schreibt beim Heim-Laden einen Snapshot (HomeWidgetData) in die App Group und triggert WidgetCenter-Reload; Snapshot wird bei Logout/401 geleert. Siri-/Kurzbefehl (E): - StartWalkIntent „Gassi gehen" + AppShortcutsProvider (öffnet die App). - WalkLauncher überbrückt Intent → UI: Flag in der App Group, beim Aktivwerden eingelöst → Aufnehmen-Tab + Aufnahme-Start (TrackingView.startFresh). - MainTabView mit Tab-Auswahl (Tags), BanYaroGoApp liest scenePhase.
This commit is contained in:
parent
a2646a18ef
commit
d807db57a2
14 changed files with 307 additions and 6 deletions
32
BanYaroGo/Support/StartWalkIntent.swift
Normal file
32
BanYaroGo/Support/StartWalkIntent.swift
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import AppIntents
|
||||
|
||||
/// Siri-/Kurzbefehl-Intent „Gassi gehen": öffnet die App und stößt die
|
||||
/// Aufzeichnung an (über das App-Group-Flag, das die App beim Aktivwerden liest).
|
||||
struct StartWalkIntent: AppIntent {
|
||||
static var title: LocalizedStringResource = "Gassi gehen"
|
||||
static var description = IntentDescription("Startet die Aufzeichnung einer Gassi-Tour in Ban Yaro Go.")
|
||||
static var openAppWhenRun: Bool = true
|
||||
|
||||
@MainActor
|
||||
func perform() async throws -> some IntentResult {
|
||||
WalkLauncher.requestStartViaAppGroup()
|
||||
WalkLauncher.shared.pendingStart = true // Fast-Path, falls in-process
|
||||
return .result()
|
||||
}
|
||||
}
|
||||
|
||||
/// Macht den Intent als Siri-Phrase + Kurzbefehl verfügbar (automatisch erkannt).
|
||||
struct BanYaroAppShortcuts: AppShortcutsProvider {
|
||||
static var appShortcuts: [AppShortcut] {
|
||||
AppShortcut(
|
||||
intent: StartWalkIntent(),
|
||||
phrases: [
|
||||
"Gassi gehen mit \(.applicationName)",
|
||||
"Geh Gassi mit \(.applicationName)",
|
||||
"\(.applicationName) Gassi gehen"
|
||||
],
|
||||
shortTitle: "Gassi gehen",
|
||||
systemImageName: "figure.walk"
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue