fix(widget): Photo et Scanner ouvraient une page au hasard
Les deux liens utilisaient un schéma custom `coachapp://` que rien ne route : le projet passe par les Universal Links (entitlement associated-domains), comme les widgets Séance du jour et Score de forme, qui pointent tous deux sur des URL https. L'app s'ouvrait donc sur sa dernière page consultée — le score de sommeil en l'occurrence. Les liens passent en https://coach.hypnotruck.ch/meals?photo=1 et ?scan=1, et le schéma custom que j'avais ajouté à l'Info.plist est retiré : il ne servait à rien et aurait laissé une fausse piste. J'avais écrit ces URL sans lire comment les widgets voisins s'y prenaient — même faute que pour `todayISO`, supposer un mécanisme au lieu de le vérifier. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -81,14 +81,6 @@
|
|||||||
<string>com.googleusercontent.apps.817483900105-amoanmsold3j3k71retpjuhvrknsuunh</string>
|
<string>com.googleusercontent.apps.817483900105-amoanmsold3j3k71retpjuhvrknsuunh</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
|
||||||
<key>CFBundleURLName</key>
|
|
||||||
<string>ch.hypnotruck.coach.deeplink</string>
|
|
||||||
<key>CFBundleURLSchemes</key>
|
|
||||||
<array>
|
|
||||||
<string>coachapp</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -141,13 +141,19 @@ struct CoachQuickWidgetView: View {
|
|||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
.labelStyle(.titleAndIcon)
|
.labelStyle(.titleAndIcon)
|
||||||
|
|
||||||
// Photo et code-barres OUVRENT l'app : la caméra exige le premier
|
/* Photo et code-barres OUVRENT l'app : la caméra exige le premier
|
||||||
// plan. Le widget économise les navigations, pas le lancement.
|
plan. Le widget économise les navigations, pas le lancement.
|
||||||
|
|
||||||
|
URL **https** et non schéma custom : le projet route ses liens de
|
||||||
|
widget par Universal Links (entitlement associated-domains), comme
|
||||||
|
les widgets Séance du jour et Score de forme. Un `coachapp://`
|
||||||
|
n'est routé nulle part — l'app s'ouvrait alors sur sa dernière
|
||||||
|
page consultée, au hasard. */
|
||||||
HStack(spacing: 6) {
|
HStack(spacing: 6) {
|
||||||
Link(destination: URL(string: "coachapp://meals?photo=1")!) {
|
Link(destination: URL(string: "https://coach.hypnotruck.ch/meals?photo=1")!) {
|
||||||
Label("Photo", systemImage: "camera.fill")
|
Label("Photo", systemImage: "camera.fill")
|
||||||
}
|
}
|
||||||
Link(destination: URL(string: "coachapp://meals?scan=1")!) {
|
Link(destination: URL(string: "https://coach.hypnotruck.ch/meals?scan=1")!) {
|
||||||
Label("Scanner", systemImage: "barcode.viewfinder")
|
Label("Scanner", systemImage: "barcode.viewfinder")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user