Widget kit deep link
What family (size) widget are you using?
Does your app already support deep links?
Are you using a SwiftUI App, or a UIApplicationDelegate?
What family (size) widget are you using?
Does your app already support deep links?
> Yes. I can trigger the deep link from terminal (xcrun simctl ---)
Are you using a SwiftUI App, or a UIApplicationDelegate?
> For the main app, we are using UIApplicationDelegate.
Note that Link will only work in systemMedium and systemLarge, for deep linking from a systemSmall widget, you'll need to use widgetURL: https://developer.apple.com/documentation/swiftui/view/widgeturl(_:)What family (size) widget are you using?
> I tried all 3 sizes (small, medium, large)
When your widget gets tapped your app should be passed the URL, if you support scenes your scene delegate should get a scene(_:openURLContexts:) call, otherwise your application delegate should get a application(_:open:options:) call.Does your app already support deep links?
> Yes. I can trigger the deep link from terminal (xcrun simctl ---) Are you using a SwiftUI App, or a UIApplicationDelegate?
> For the main app, we are using UIApplicationDelegate.
https://developer.apple.com/forums/thread/651786
Solved: My Link wasn't working inside of my View for some reason, but it worked when I put it around my view
what didnt work:
Code Block View(){ Link(){ ... } } Widget(){ View() }
what did work:
Code Block View(){ ... } Widget(){ Link(){ View() } }
Please file a radar to ensure that the below is reflected in the docs. It took me a bit too long to find this thread. Thanks!
Note that Link will only work in systemMedium and systemLarge, for deep linking from a systemSmall widget, you'll need to use widgetURL: https://developer.apple.com/documentation/swiftui/view/widgeturl(_:)
You said,
"I've just got .widgetURL working, but how do i work that with a medium or large widget? I can't get a Link working. Its annoying to only be able to have one .widgetURL when my widget has multiple views
Solved: My Link wasn't working inside of my View for some reason, but it worked when I put it around my view
what didnt work:
Code Block
View(){ Link(){ ... }}Widget(){ View()}
what did work:
Code Block
View(){ ...}Widget(){ Link(){ View() }}"
Could you actually show the example code? The way you have it doesn't make sense to me. Please?
WidgetKit needs add openURL to App Store from SwiftUI Link View