Thursday, June 16, 2016

Siri and Maps interact with your app’s services through two different types of extensions:

To support SiriKit, you use the Intents framework and Intents UI framework to implement one or more extensions that you then include inside your iOS app.

We can add SiriKit if and only if app supports any of the following. These are called domains.

Audio or video calling
Messaging
Payments
Searching photos
Workouts
Ride booking

Siri and Maps interact with your app’s services through two different types of extensions:

An Intents extension communicates your app’s content to Siri and Maps and performs the tasks associated with any supported intents.
An Intents UI extension provides a custom interface for your content within the Siri or Maps interface. This extension is optional.

Siri handles the language processing and semantic analysis needed to turn the user’s spoken requests into actionable intents that your extensions can handle. Siri and the Maps app manage all user interactions and display the results to the user using a standard system interface. Your role is primarily to provide the data to display. If your app includes an Intents UI extension, you can also provide a custom interface to supplement the default system interface.

Ride booking and restaurant reservations are handled primarily by the Maps app, although users can also book rides using Siri. Your Intents extension handles interactions that originate from the Maps app in the same way it handles requests coming from Siri. If you customize the user interface, your Intents UI extension can configure itself differently depending on whether the request came from Siri or Maps.

Creating intents extension

The entry point of your Intents extension is the INExtension object, whose sole job is to direct Siri to the objects capable of responding to user requests. When implementing an Intents extensions, there are three types of objects that you use regularly:

An intent object defines the user’s intent and contains the data that Siri gathered from the user.
A handler object is a custom object that you define and use to resolve, confirm, and handle an intent.
A response object is a data object containing your response to an intent.
When there is an intent for your extension to handle, Siri asks your INExtension object for an object capable of handling that intent. A handler object can be any type that you want, but it must implement the specific methods needed to handle the given intent. Each intent has an associated protocol that its handler must adopt. The methods of this protocol are divided into three groups: resolution methods, confirmation methods, and handling methods. We need to implement the methods you need and provide Siri with information about how you plan to handle the intent.

references:

https://developer.apple.com/library/prerelease/content/documentation/Intents/Conceptual/SiriIntegrationGuide/index.html

No comments:

Post a Comment