openAppWhenRun = true is wrong

import AppIntents

struct MGIntents: AppIntent { static var title = LocalizedStringResource("open app") static var openAppWhenRun: Bool = true func perform() async throws -> some IntentResult & ProvidesDialog { return .result(dialog: "app open") } }

struct AppItentsShortcuts:AppShortcutsProvider {

static var appShortcuts: [AppShortcut] {
    AppShortcut(intent: MGIntents(),
                phrases: ["\(.applicationName) Open app"],
                shortTitle: "Open app",
                systemImageName: "fan.desk.fill")

}

} when use ,error more error。

when i delet openAppWhenRun ,is ok。why? how I can do it? thank you!

LATFORM AND VERSION iOS Development environment: Xcode Version 16.3 (16E140), macOS 15.4.1 (24E263) Run-time configuration: iOS 18.4

Could this help find out the solution ? https://www.createwithswift.com/integrating-app-intents-with-control-action/

Please see this other thread — do you have the same configuration? If I have that right, note that there's been a few changes since I wrote that previous answer, notably, that openAppWhenRun is now deprecated, and you should look at supportedModes instead.

— Ed Ford,  DTS Engineer

openAppWhenRun = true is wrong
 
 
Q