0

I created a new iOS widget based by one of my iOS application witch is using UIKit.

I using swiftUI to create the widget and everything is fine.

So I trying to finish it with a Url deeplink from this widget.
The code is looks like this

var body: some View {
    VStack {
        Text(entry.title).multilineTextAlignment(.center)
    }
    .widgetURL(URL(string: "myscheme://deeplink/listing?pid=widget_init")!)
}

widgetURL works fine and I received the url from my AppDelegate

public func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool

The question is I just get the url but everything in options is nil.
Does someone know why the bundle id that should be inside options now is nil?

I want know if the deeplink is come from my widget. Or if there's some other way can get it?

pawello2222
  • 46,897
  • 22
  • 145
  • 209
Shaggon
  • 53
  • 6
  • 3
    Register unique url scheme or give unique url query parameters when open from widget and use that as indicator. – Asperi Feb 26 '21 at 05:05
  • Thanks this is the way like I did just now, add a unique url query parameters. But the parameters also can be used in every app not only in my widget. I'm going to tracking this. So if possible I want more correct information. – Shaggon Feb 26 '21 at 07:25

0 Answers0