3

I have a widget that opens my app via a custom url scheme (myapp:some-deep-link). In my app I have a handler setup like so:

var body: some Scene {
        WindowGroup {
            
            ContentView()
            .onOpenURL(perform: { url in
               //my code
            }
         }
     }  

In iOS 14 this works perfectly, in iOS 15 (Simulator) onOpenURL is not called at all. The app launches, but there is no call. I am wondering if this might be a simulator problem or a bug or something I am doing wrong. Any ideas?

Nicolas
  • 755
  • 9
  • 22
  • `onOpenURL` is working fine in my Widget to app, for iOS 15. Did you try and print the url to see if anything is called? – cole Sep 30 '21 at 03:00
  • I put a breakpoint in the closure and it does not break. :( Do you also have other userActivity related methods applied to your content view? – Nicolas Sep 30 '21 at 11:13
  • 4
    In case someone has the same problem. If you used a workaround from here https://stackoverflow.com/questions/57063142/swiftui-status-bar-color to change the status bar color and roll your own HostingController. That breaks onOpenURL. :( – Nicolas Sep 30 '21 at 13:30
  • I had the same problem. – tichise Oct 07 '21 at 09:50
  • 1
    oops... did anyone find a solution to this? Our designer would be really mad at us if we remove the status bar color! – anemo Nov 19 '21 at 23:21

0 Answers0