diff --git a/ios/Platform/Platform/ContentView.swift b/ios/Platform/Platform/ContentView.swift index e74aa9a..45f320b 100644 --- a/ios/Platform/Platform/ContentView.swift +++ b/ios/Platform/Platform/ContentView.swift @@ -120,6 +120,12 @@ struct MainTabView: View { .sheet(isPresented: $showAssistant) { AssistantSheetView(onFoodAdded: foodAdded) } + .onOpenURL { url in + if url.scheme == "platform" && url.host == "add-food" { + selectedTab = 1 // Fitness tab + showAssistant = true + } + } .task { guard showReader else { return } let renderer = ArticleRenderer.shared diff --git a/ios/Platform/PlatformWidget/PlatformWidget.swift b/ios/Platform/PlatformWidget/PlatformWidget.swift index 2b44ee0..4c7768d 100644 --- a/ios/Platform/PlatformWidget/PlatformWidget.swift +++ b/ios/Platform/PlatformWidget/PlatformWidget.swift @@ -290,6 +290,7 @@ struct PlatformWidget: Widget { var body: some WidgetConfiguration { StaticConfiguration(kind: kind, provider: CalorieProvider()) { entry in PlatformWidgetEntryView(entry: entry) + .widgetURL(URL(string: "platform://add-food")) .containerBackground(.fill.tertiary, for: .widget) } .configurationDisplayName("Calories")