Siri Intent: 'Siri, count for '

Hi, I’m developing an app, which just like Clock App, uses multiple counters.

I want to speak Siri commands, such as “Siri, count for one hour”. ‘count’ is the alternative app name.

My AppIntent has a parameter, and Siri understands if I say “Siri, count” and asks for duration in a separate step. It runs fine, but I can’t figure out how to run the command with the duration specified upfront, without any subsequent questions from Siri.

Clock App has this functionality, so it can be done.

    //title
    //perform()
    
    @Parameter(title: "Duration")
    var minutes: Measurement<UnitDuration>
}

I have a struct ShortcutsProvider: AppShortcutsProvider, phrases accept only parameters of type AppEnum or AppEntity.

As you found, the phrases that are part of your AppShortcutsProvider cannot be open ended, like an open ended minute duration.

I have a struct ShortcutsProvider: AppShortcutsProvider, phrases accept only parameters of type AppEnum or AppEntity.

I usually like to start people off with an AppEnum to see if that works for their needs. For example, if your app needs a small number of fixed common countdown durations, like 5 minutes, 15 minutes, 30 minutes, and 60 minutes, those could be your enum values. As a different way of doing that, if your app is focused on specific tasks, like a workout timer, your AppEnum could model your count downs with task names for your enum cases, like a run timer vs a cool down timer.

— Ed Ford,  DTS Engineer

Siri Intent: 'Siri, count for '
 
 
Q