Siri, we love you!
We have all encountered Siri—your virtual personal assistant. Siri was introduced in iOS 5 as a part of the iPhone 4S in the fall of 2011. By the fall of 2012 it was fully baked and utilized in iOS 6. Since that time Siri has been an Apple-controlled feature that was not exposed to third-party developers—that changes with iOS 10!
That’s great but what does it mean for me? It means integration and usage of Siri for your apps! Check out the SiriKit introduction to see how the newest changes can be useful for your apps.
Use cases are specifically designed to work with both Siri and Maps and are broken down into the following domains:
- VoIP Calling
- Ride Booking
- CarPlay (auto vendors only)
- Restaurant (requires additional Apple Support)
Each of the above categories can be associated with an Intent (action) that may make sense to your app. As you can see, it is limited to global actions that are appropriate for Apple right now. The integration and intents do require some significant steps if you use the recommended path from Apple.
SiriKit is integrated with a new framework, the Intents Framework. To utilize these intents you must create an Intents Extension. The intents can be considered to be having a conversation with Siri, depending on the steps within the conversation. This somewhat follows a normal human language request—be clear what the request is (resolve), confirm what the request is (confirm), and then process the request (handle). With the Intents Framework we are able to control the resolution, confirmation, and handling of a voice request. In addition to an Intents Extension that provides voice handling through Siri, you can add an Intents UI Extension to provide custom user experience to the response within Siri.
What are these intents are how do we use them? The Intents framework is build around three actions.The first action is to “resolve” the request. Let’s consider an app that helps dart players calculate the “outs” in a 501 game. A request might be something like, “Siri, please use DartOutDawg to give me the out for 135.” The second action is to “confirm” the request. This may be like something like, “Did you mean dart Out Dawg or DartOutDawg?” The third action is to “handle” the request. This means the app handles the request and responds via Siri.
Let us say that you have app that applies to one of the supported domains. How do we use the new framework?
To enable SiriKit in Xcode, navigate to TARGETS and select your target, then under the Capabilities tab, enable Siri.
Create the new Intent extension. Then click on the target and add files. You will see the intents extension option.
You will be presented with an OK dialog—click OK. When you are done you will have two new extensions added to your project, one for Siri voice handling and one for custom user interface injection into Siri.
Now we are at a place where we can begin building the Intents Extension and the Intents UI Extension. We have shown you how to set up a basic Intent for use with Siri. We anticipate some of our clients will be excited about SiriKit integration. What about yours?
Hope you enjoyed this quick tour of SiriKit! Below are several important links detailing SiriKit integration.
Enjoy iOS 10!
This article is part of our Welcome to iOS 10 series.