Why doesn't my App Shortcut appear in Shortcuts when using a parameter, but it works when I remove the parameter?
class AppShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: ConnectIntent(),
phrases: [
"Call \(\.$name) in \(.applicationName)"
],
shortTitle: "Call",
systemImageName: "sparkles"
)
}
}
However, when I remove the parameter, it appears in Shortcuts:
class AppShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: ConnectIntent(),
phrases: [
"Call in \(.applicationName)"
],
shortTitle: "Call",
systemImageName: "sparkles"
)
}
}
Intent:
struct ConnectIntent: AppIntent {
static var title: LocalizedStringResource = "Call"
@Parameter(title: "name")
var name: String
func perform() async throws -> some IntentResult & ProvidesDialog {
try await CallerService.shared.call(selectedName: name)
return .result(dialog: "Calling now")
}
}