How to create ControlWidget button that opens my App

Hi, I want to create a ControlWidget button that acts as a shortcut in the control center open a specific view within my app to show a badge. Problem: I can‘t get it to open my host app. I tried a custom myapp:// protocol - did not work, I tied AppIntent with the openAppWhenRun set to true - did not work and the strange thing is the debugger breakpoint in perform will only get triggered if this is set to false. OpenIntent did not work either even if I use a dummy swift app as host to try it out.

What is the current supported way (iOS 18 and 26) to open your app when a static ControlWidget button is clicked, what could I have done wrong / am missing?

Answered by pauloDEv in 881105022

I found a solution my putting the intent into a shared framework and linking it with public struct SharedIntentsPackage: AppIntentsPackage to the app and the widget so iOS will propagate it into the metadata. It works but looks to unintuitive to me compared to the usual apple system integration apis.

Accepted Answer

I found a solution my putting the intent into a shared framework and linking it with public struct SharedIntentsPackage: AppIntentsPackage to the app and the widget so iOS will propagate it into the metadata. It works but looks to unintuitive to me compared to the usual apple system integration apis.

How to create ControlWidget button that opens my App
 
 
Q