I am working on a Siri extension and I am wondering if it is possible to change Siri's response based on the situation.
For example, if the application is supported while iPhone is charging and if the user asks for some actions from Siri while it is not charging, I want Siri to answer "'App Name' requires iPhone to be charging in order to handle the action."
- (id)handlerForIntent:(INIntent *)intent {
if(charging){
//Phone is charging; pass corresponding handler
...
}else{
//Phone is not charging; tell user to charge phone
return nil;
}
}
At this point, if I return nil in the handleForIntent
, Siri just shows
Basically I want to change the "Sorry, there was a problem with the app." with my own error message.
Some answer suggested to use AVSpeechSynthesizer
to convey my error message but it has a couple of issues.
AVSpeechSynthesizer
overlaps with Siri response.- Cannot change the displayed message on the Siri screen.
If anyone knows how to modify Siri's response (both text and speech), please provide me with some advice.