From 54108381dd9f170fd96fa6540b35a369d4974ca4 Mon Sep 17 00:00:00 2001 From: Sylvain Bettinelli Date: Thu, 6 Aug 2026 13:24:01 +0000 Subject: [PATCH] =?UTF-8?q?Widget=20Saisie=20rapide=20:=20bundle,=20sch?= =?UTF-8?q?=C3=A9ma=20d'URL=20et=20synchro=20c=C3=A2bl=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Trois des étapes du runbook sont des fichiers texte, donc faisables hors Xcode : * `CoachQuickWidget()` enregistré dans `CoachLiveActivityBundle`, sous `if #available(iOS 17.0, *)` — le bundle sert aussi des cibles antérieures ; * schéma `coachapp://` déclaré dans l'Info.plist de l'App. Il n'y était pas : seul le schéma Google était présent, et les boutons Photo et Scanner du widget n'auraient donc rien ouvert ; * `CoachQuickSync.flush()` appelé depuis `applicationDidBecomeActive`, qui était un corps vide. Ne restent en manuel que les gestes qui touchent le projet Xcode lui-même : Target Membership des trois fichiers Swift, puis le build. Co-Authored-By: Claude Opus 5 --- ios/App/App/AppDelegate.swift | 7 ++++++- ios/App/App/Info.plist | 8 ++++++++ ios/App/CoachLiveActivity/CoachLiveActivityBundle.swift | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift index e960af6..6575b45 100644 --- a/ios/App/App/AppDelegate.swift +++ b/ios/App/App/AppDelegate.swift @@ -50,7 +50,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func applicationWillResignActive(_ application: UIApplication) {} func applicationDidEnterBackground(_ application: UIApplication) {} func applicationWillEnterForeground(_ application: UIApplication) {} - func applicationDidBecomeActive(_ application: UIApplication) {} + func applicationDidBecomeActive(_ application: UIApplication) { + // Les saisies faites depuis le widget (eau, café) attendent dans l'App + // Group : une extension n'a ni session ni droit de tenir une requête. + // On les transmet ici, à chaque retour au premier plan. + Task { await CoachQuickSync.flush() } + } func applicationWillTerminate(_ application: UIApplication) {} func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist index 9e97689..7a57999 100644 --- a/ios/App/App/Info.plist +++ b/ios/App/App/Info.plist @@ -81,6 +81,14 @@ com.googleusercontent.apps.817483900105-amoanmsold3j3k71retpjuhvrknsuunh + + CFBundleURLName + ch.hypnotruck.coach.deeplink + CFBundleURLSchemes + + coachapp + + diff --git a/ios/App/CoachLiveActivity/CoachLiveActivityBundle.swift b/ios/App/CoachLiveActivity/CoachLiveActivityBundle.swift index c344775..70adbb7 100644 --- a/ios/App/CoachLiveActivity/CoachLiveActivityBundle.swift +++ b/ios/App/CoachLiveActivity/CoachLiveActivityBundle.swift @@ -12,5 +12,7 @@ struct CoachLiveActivityBundle: WidgetBundle { CoachLiveActivityWidget() CoachTodaySessionWidget() CoachFormeScoreWidget() + // Saisie rapide : App Intents (iOS 17+) pour l'eau et le café. + if #available(iOS 17.0, *) { CoachQuickWidget() } } }