In which, I use Siri to create in-app third party commands while taking a break from cooking for Thanksgiving
Earlier today, I had a brainstorm. Maybe I was just overthinking the whole custom Siri thing for third party apps. I didn't want to install a proxy server or jailbreak my iPhone. I just wanted to use Siri dictation to issue commands to my apps, and I wanted to do that without having to display a keyboard that took up 50% of my iPhone screen.
So I chatted with Steven Troughton-Smith about overriding the keyboard by setting its inputView to a custom toolbar, and then using a button to start and stop Siri dictation. This last bit, the custom UI (sorry, but I wanted pretty) is the only "hacking" per se involved here. Instead of overwhelming the screen, he suggested I link directly to UIDictationController and tell it to start and stop dictation.
Originally, I was really aiming for doing a custom view without text at all and implementing UITextInput but apparently there's some other protocol I'm missing, so I ended up reverting to the standard text field with the blinking cursor you see at the top of the video. I'll figure that bit out later.
So what I do is this: I start dictation on the button press, stop it on the button release, and then catch the interpreted text and compare it against four words: up, down, left, and right. If these are found, the app runs the matching animation.
The big idea is this: instead of having Siri interpret commands and return ACE objects that match tasks I want to accomplish (my original approach), I do the text matching and interpretation myself.
In the end, the solution is both low rent and really easy to apply. You could even get this in App Store if you were willing to show the entire keyboard, and not just the start/stop button.
Check it out in action here:
Earlier today, I had a brainstorm. Maybe I was just overthinking the whole custom Siri thing for third party apps. I didn't want to...
Deals of the Daymore deals
Software Updatesmore updates
- Agile Partners releases Lick of the Day 2.0
- Microsoft Office for Mac 2011 Update 14.3.4
- Pixelmator 2.2 available with over 100 new features and improvements
- DabKick for iPhone lets you share photos, watch videos and now listen to music in real-time
- Google Now added to search app on iPhone, iPad
- GateGuru for iPhone has been updated and greatly improved