App Intents: Siri does not recognize currency amounts

Hello,

I am implementing an App Intent which asks the user for a currency amount:

private func loadAmountList(forNumber number: String) async throws -> [NSDecimalNumber] {...}

@MainActor func perform() async throws -> some IntentResult & ShowsSnippetView {

    let list = try await loadAmountList(forNumber: fixedNumber).compactMap {
    currencyFormatter.string(from: $0)
}

    throw $amount.needsDisambiguationError(among: list, dialog: "app_intent_sim_amount_prompt")
}

If I start this intent from Siri, the attached screenshot is shown, but no matter what I say ("10 EURO", "ten", "10", "10€"...) Siri never understands anything and keep reshowing the dialog over and over again. If instead I tap any of the choices then the intent execution proceeds currectly.

How can I solve the problem? Thanks

Answered by nicolas in 813902022

Hey there! I had to use an IntentCurrencyAmount parameter type (instead of Double or NSDecimalNumber), but then had to manually ask for the parameter value in the perform() method because it defaults to having a value of 0.

Accepted Answer

Hey there! I had to use an IntentCurrencyAmount parameter type (instead of Double or NSDecimalNumber), but then had to manually ask for the parameter value in the perform() method because it defaults to having a value of 0.

App Intents: Siri does not recognize currency amounts
 
 
Q