The system requires the Target Membership of the app intent to be set to both the app and the widget extension to open the app
We can open our app with OpenIntent
Set your control’s action to an app intent that conforms to OpenIntent to open your app when someone uses a control. Using OpenIntent allows you to take someone to a specific area of your app when a control performs its action.
The system requires the Target Membership of the app intent to be set to both the app and the widget extension to open the app.
import AppIntents
struct LaunchAppIntent: OpenIntent {
static var title: LocalizedStringResource = "Launch App"
@Parameter(title: "Target")
var target: LaunchAppEnum
}
Another way is to use OpenURLIntent from iOS 18 to open universal link
In iOS 18, we can make Control Widget in Widget extension
From Creating controls to perform actions across the system
We can open our app with
OpenIntent
The system requires the Target Membership of the app intent to be set to both the app and the widget extension to open the app.
Another way is to use OpenURLIntent from iOS 18 to open universal link
Note that you need to use a universal link for your URL representation, you can’t use a custom URL scheme.
Read more