I have a few Custom Intents defined in an intents definitions file. One of these intents allow the user to capture an expense. Naturally, one of the parameters for the expense is the amount charged.
When I initially created these intents in November 2022, this intent worked brilliantly. The user specified the amount, in the way you would usually communicate a currency amount by including words like "dollar" or "cents", and all worked well.
About a month ago, a user informed me about a problem with the intent. All parameter values resolved except for the expense amount parameter. No matter what you provided for the expense amount, Siri would reply with "expense amount cannot be negative". Investigating the issue confirmed the problem. I'm unable to determine exactly when this started happening as most of our users don't use the Siri integration and not all users inform us about issues they find.
I implemented a temporary workaround and finally have the time to spend to resolve this problem.
I added a breakpoint to the intent handler's "resolveParameterExpenseAmount" method to see where the breakdown in communication was. First, the breakpoint was never hit. Siri would still reply with "expense amount cannot be negative".
I realised the Validation Errors defined in the parameter's settings were catching the value before I was asked to resolve it in the intent handler.
So I removed all of the validation errors (you can't remove them with the minus sign below, I just hit back space on the keyboard on each one). This time, the breakpoint was hit, but the expense amount was nil.
To make sure I wasn't messing something up with this parameter being part of a whole bunch of other parameters, I decided to create just a simple Test intent.
This is the properties on the custom intent:
There is one parameter, configured like this:
The section under Shortcuts app:
The section under Suggestions:
As for the response section, I kept it very basic:
Finally, the intent handler for this test intent:
This is a very basic test. Once again, after invoking the intent, Siri asks me for the test amount. Upon giving it to her, the reply: "Test Amount can't be negative".
To change things up a little regarding "the negative number validation", I change the minimum value to -1, allowing the value to be negative.
This time, no matter the amount I specify (including amounts like "one" and "zero"), the standard reply is: "Test Amount can't be higher than one hundred thousand".
The one thing I'm uncertain about, is the "Currency Codes" section in the parameter settings:
I don't know if I have to add the currencies the user can possibly talk about there? I can't find any proper documentation on the parameter settings specifically related to Currency Amount.
For now, the work around remains in place. I changed my expense amount to type "Decimal". The drawback is that Siri cannot infer $542.62 from "Five hundred and forty two dollars and sixty two cents". I had to change the prompt to: "What is the expense amount? Specify only the numeric value and do not include currency metrics like dollar and cents."
Really? That's just ridiculous! Especially since the Currency Amount parameter worked absolutely fine a few months ago.
Are my settings wrong in the definition file? Is there an issue with SiriKit's validation on Currency Amounts? Must I specify currency codes somewhere?
I'm not sure what else to try.
Any advice will be greatly appreciated.
Post
Replies
Boosts
Views
Activity
I have a Driving Task CarPlay entitlement. While connected to CarPlay, I can ask Siri to open any of the apps on the CarPlay Console.
Granted, I suspect none of the apps I have fall under Driving Task entitlements. Audible, Audio Books and Music would likely be Audio apps. WhatsApp and Telegram will be Communication, Waze and Maps will be Navigation.
I have SiriKit intents to do various tasks in the app. When I use Siri and issue those commands, they all work, regardless of whether I'm connected to CarPlay or Not.
What baffles me is that I can't ask Siri to simply open my app on the CarPlay console. She keeps responding with “Sorry, I can’t do that while you’re driving.”
I've read through the CarPlay App Programming Guide. The guide mentions the following:
All voice interaction must be handled using SiriKit (with the exception of CarPlay navigation apps)
Under additional guidelines for communication apps, it mentions that your app must support VOIP calling features via specific SiriKit intents.
Under additional guidelines for navigation apps, they mention that voice control must be limited to navigation features.
I don't see any special mention of voice control related to Driving Task apps.
When I ask Siri to open my app on the iPhone, it just happens. I didn't have to do anything specifically to have this functionality.
Why can't I open my app with Siri on the CarPlay console?
I am new to using Siri Shortcuts. I can't figure out what I'm doing wrong.
I have a custom intent in aSiriKit Intents Definition File.
The intent has one parameter.
The parameter type is a custom type
The custom type has only an identifier and display string.
I am trying to set Shortcut Suggestions using my custom intent. I first create the shortcut with the intent.
Then suggest it.
This is the feedback in the output window.
The only place where "combinations" are mentioned is under the "Shortcuts app" and "Suggestions" section in the definitions file. I on'y have one supported combination, which is the vehicleParameter.
I would appreciate some guidance on what I'm doing wrong.
Thanks