Reputation: 105
I implemented Siri Shortcuts in my app as well as Siri Custom UI handling and everything works as expected.
What I'm trying to achieve now is to use both Siri Intent Response, and Siri UI response when handling the intent. Let's say that the example would be:
So, in my Intent Handler I can use:
func handle(intent: MyIntent, completion: @escaping (MyIntentResponse) -> Void) {
let userActivity...
completion(MyIntentResponse(code: .success, userActivity: userActivity))
}
to show custom UI View, or I can use:
func handle(intent: MyIntent, completion: @escaping (MyIntentResponse) -> Void) {
completion(.success(customIntParameter: 90))
}
to let Siri speak the sentence provided in Intent response with my custom Int parameter.
Now, I'm wondering if there is a way to show my custom UI and make Siri speak the response. Basically to use both of these completion somehow. Any ideas?
I wouldn't like to use some text-to-speech speaking solutions, but use native Siri response.
Upvotes: 0
Views: 123
Reputation: 105
Ok, found it!
func handle(intent: MyIntent, completion: @escaping (MyIntentResponse) -> Void) {
let userActivity...
let response = MyIntentResponse(code: .success, userActivity: userActivity)
response.customIntParameter = 90
completion(response)
}
Simple as that.
Upvotes: 0