Woot, Siri now understands, in a suuuuper basic and templatey way, how to set the Right Meow status!
Since it's easier to test with the iPhone simulator than the watch simulator, I decided to start implementing the Siri extension on the iPhone-half of the app first. This revealed two main problems:
Siri's ability to grasp the pronunciation of "Right Meow" is sadly limited out of the box (an expected outcome, really).
Syncing data across all of an app's extensions is a process filled with more goat-stealing trolls than a fairytale bridge (sad, but also expected.)
1. I Thought I Heard You Say “Right... Meow”?
I can't get mad at Siri for having trouble with this one. Siri understands the pronunciation of "Right Meow" in the context of "Launch the app Right Meow!". However, in the context of “create a reminder RightMeow” she autocorrects to "Right Now", because that's probably what most people want (I mean, duh).
Apple helpfully provides an API for supplying Siri with extra vocabulary that's specific to your app, so tomorrow I'll look into expanding Siri's vocabulary with some extra Intent Phrases and Parameter Vocabularies that will make her a RightMeow champion.
For now I’ve just been testing my Intents implementation with an Xcode run scheme that provides a written Intent Query Siri can for sure understand:
2. I Sync, Therefore I am
The thing about extensions (which Siri and watch face complications are), is that they’re run in environments outside your main app. This means you need a way to sync data between your apps and these extensions. Enter App Groups!
Using app groups was tantalizing because I barely had to change my implementation for storing data (I’m just using UserDefaults). All I had to do was change a few project settings and BAM - theoretically all my extensions would be reading from the same place!
This worked great for exchanging data between the Siri extension and my main app because they both run on the some device. Unfortunately this failed spectacularly when it came to syncing data across the watch app, the watch extension, and the main app.
At one point all three of my main apps/extensions were sporting data with different levels of freshness, as I’ve illustrated with incredible artistic precision:
Either I’ve made an interesting configuration error or this is just UserDefaults making excellent and depressing use of caching. I’m probably gonna have to come up with a better way to store data if I want to sync it reliably between watch, phone, and extensions.
Tomorrow:
Tomorrow’s tasks are legion: update Siri’s vocabulary, give her a better response template, and maybe even find a good way to keep data synced across our devices. If I’m feeling super ambitious I might even look into iCloud for syncing.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Since iOS 8 app developers are able to implement a communication between their apps (like an app with a widget). For example you want to change the settings of the widget within your app.
Actually the most developers are using therefore the "NSUserDefaults". But there is a difference between the normal and the "App Group" NSUserDefaults. Here´s an example:
Important:
In order to use NSUserDefaults for App Groups you need to register an "App Group" at the Apple Developer Center at the "Certificates, Identifiers & Profiles" page. Additionally you need to add the "App Group" option to your app (Select target > Capabilities > App Groups).
More Information about NSUserDefaults
If you have questions send me a mail to hi(at)developing.io.