Hello,
I have an app with two AppIntents. I invoke first AppIntent with my voice command, then I would like invoke the second AppIntent after the first one. I have implemented the necessary return type for the first AppIntent. My first AppIntent is invoked and executes successfully, however when it calls the second AppIntent, everything inside perform() method in the second AppIntent works but Siri dialog. Siri doesn't say the dialog in the second AppIntent.
Below implementation details for my two AppIntents together with AppShortcutsProvider. I appreciate any help.
struct MyFirstAppIntent : AppIntent {
static let title: LocalizedStringResource = "Show My Usages"
func perform() async throws -> some ProvidesDialog & OpensIntent {
let dialogStr = IntentDialog(stringLiteral: "You have a package")
print("I'm in first AppIntent")
return .result(opensIntent: MySecondAppIntent(), dialog: dialogStr)
}
struct MySecondAppIntent: AppIntent {
static let title: LocalizedStringResource = "Show My Usages"
func perform() async throws -> some IntentResult & ReturnsValue<String> & ProvidesDialog {
print("I'm in second AppIntent")
return .result(value: "Listing Packages",
dialog: "You have activated Default")
}
struct MyVoiceShortcutProvider : AppShortcutsProvider {
@AppShortcutsBuilder
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: MyFirstAppIntent(),
phrases: ["Call my first intent \(.applicationName)"]
);
AppShortcut(
intent: MySecondAppIntent(),
phrases: ["Call my second intent \(.applicationName)"]
);
}
}