Hello,
I am working on an app that uses App Intents to enable users to interact with Siri. Here is the code I'm using:
struct SiriPassMeLuna: AppIntent {
static var title: LocalizedStringResource = "Pass me Luna"
static var description = IntentDescription("Lets you query Luna and receive a response.")
@Parameter(title: "Phrase")
var phrase: String?
func perform() async throws -> some IntentResult {
guard let providedPhrase = phrase else {
throw $phrase.needsValueError("What do you need help with?")
}
let request = Request()
let reply = request.sendRequest(transcription: providedPhrase)
return .result(dialog: "\(reply)")
}
}
struct SiriAppShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: SiriPassMeLuna(),
phrases: ["Pass me \(.applicationName)"]
)
}
}
My goal is to create a continuous conversation with Siri, where the user can speak to the intent, and then the intent keeps listening and replying without the user having to invoke Siri and the intent each time.
Is there a way to achieve this behavior, so that the conversation with Siri is more seamless, and the user doesn't have to repeatedly say "Hey Siri" followed by the intent name?
Any guidance or suggestions would be greatly appreciated. Thank you!
Post
Replies
Boosts
Views
Activity
Is it possible to create a custom app shortcut using system actions and custom intents in iOS development? For instance, can my app generate a shortcut that combines dictation text, note creation, and speech output using Siri speakers? If not, is there a way to access dictation text or Siri speakers from within my custom app intent?
Hi everyone. Can someone explain the difference between custom intents and app intents, and provide documentation for the type of intent needed to create a shortcut from an installed app with the same functionality as the manual "repeat text" shortcut created on my phone which listens for speech and repeats it using Siri speakers?