4

I am designing a widget extension with the new WidgetKit framework for iOS 14. When a user taps on a specific view in the widget, I want to open an external URL, such as tel://12345.

I already tried to use the Link(destination:label:) view and the widgetURL(_:) method, but both just open the main app. This behaviour is the same for all widget sizes (small, medium and large).

I know that in iOS 13 and before, you could open a URL that doesn't belong to your app from a widget extension. Was this capability removed in iOS 14 for whatever reasons? Or didn't I try the right way to do it?

vollkorntomate
  • 638
  • 1
  • 8
  • 17
  • As far as I recall WWDC, any tap on widget opens *only* host application, everything else is on app responsibility. – Asperi Aug 31 '20 at 19:04
  • https://stackoverflow.com/questions/63697132/detect-app-launch-from-widgetkit-widget-extension/63715553#63715553 – cafedeichi Sep 21 '20 at 07:56
  • Thanks for the answer @cafedeichi but I was looking for a way to open an external URL without opening my containing app. – vollkorntomate Sep 21 '20 at 08:58
  • look at the apple News App widget. It opens up external URL. So unless Apple is blocking the rest of the world to open external links it is somehow possible to do it. – AndiAna Jan 06 '21 at 12:20
  • 1
    for the Small widget you simply use this .widgetURL(URL(string: "www.google.com")) for the Medium and Large widget the Link should work as usual. – AndiAna Jan 06 '21 at 12:23

0 Answers0