Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Unable to pass parameters from siri phrase to appIntent

I have a chat/search functionality in my app, I want to integrate siri where user can say something "Hey siri! Ask myApp to get latest news" then I want to invoke my search functionality with "get latest news". I see iOS apps like chatGPT and youtube have already achieved this.

I am able to invoke the intent with static phrase which is expecting the parameter, user is able to provide the value when prompted after requestValueDialog. But it is a 2 step process for end user. I want to achieve in a single step. struct CombinedSiriShortcuts: AppShortcutsProvider {

static var appShortcuts: [AppShortcut] {
    return [
        AppShortcut(
            intent: ShowSpecificNewsArticleIntent(),
            phrases: [
                "Ask \(.applicationName) to run a query:",
             ],
            shortTitle: "Specific News Article",
            systemImageName: "doc.text.fill"
        ),
        AppShortcut(
            intent: TestQuery(),
            phrases: [
                "Ask \(.applicationName) to \(\.$query)",
             ],
            shortTitle: "Test intent",
            systemImageName: "doc.text.fill"
        ),
    ]
}  
}

struct ShowSpecificNewsArticleIntent: AppIntent {
static var title: LocalizedStringResource = "Show Specific News Article"

static var description = IntentDescription(
    "Provides details about a specific news article based on its title."
)

@Parameter(title: "Query")
var query: String

@MainActor
func perform() async throws -> some IntentResult & ProvidesDialog & ShowsSnippetView {
    print("in show specific intent");
    print(query);
    return .result(dialog: "view more about: \(query)")
}
}

Please see a recent thread.

— Ed Ford,  DTS Engineer

As mentioned in the referral threads, I have raised a enhancement request FB17052680. Please let me know if I need to provide any other details and help me to achieve the required. Thanks.

Unable to pass parameters from siri phrase to appIntent
 
 
Q