[iOS 10] Siri及びMapに対応するインテントを一覧してみた

2016.09.14

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

1 はじめに

WWDC16の発表で、SiriKitが公開されましたが、これが対応しているインテント(対応ドメイン)が限られたものだったということで、少しがっかりだったと言うメッセージを幾つか見ました。

確かに、限られたものであることは間違い有りませんが、実際何が出来るのかが、ちょっとハッキリしなかったので、インテントを一覧してみることにしました。

2 Handlingプロトコル

Siriは、そのライフサイクルに、ResolveConfirmHandleがありますが、このうちResolve用のメソッドだけが、各インテントごと多岐になっています。

Resolveでは、そのインテントに必要な値のバリデーションを行いますが、必要な値が、インテントごと異なるため違いが出ているのです。

例えば、サンプルコードのUnicornChat(Siriでメッセージ送信を行うサンプルアプリ)では、INSendMessageIntent(メッセージの送信)を扱っていますが、INSendMessageIntentに対応するためには、INSendMessageIntentHandlingプロトコルを実装したハンドラが必要になります。

そして、INSendMessageIntentHandlingプロトコルのResolve関連のメソッドは、次の3種類です。

func resolveRecipients(forSendMessage intent: INSendMessageIntent, 
                           with completion: @escaping ([INPersonResolutionResult]) -> Void)

func resolveContent(forSendMessage intent: INSendMessageIntent, 
                        with completion: @escaping (INStringResolutionResult) -> Void)

func resolveGroupName(forSendMessage intent: INSendMessageIntent, 
                          with completion: @escaping (INStringResolutionResult) -> Void)

上から順に、Recipients (宛先)、Content (本文)、GroupName (宛先グループ)のバリデーションを行います。

この事から、Handlerのバリデーションメソッドを見れば、Siriから受け取れるデータの種類が分かると共に、何が出来るのかも少しイメージできるのでは考えました。

3 インテントの一覧

次は、Siri及びMapに対応するIntentと、それぞれのハンドラでバリデーションされる値を一覧したものです。

ドメイン インテント/Handlingプロトコル 対応 用途 バリデーションメソッド
VoIP Calling INStartAudioCallIntent
INStartAudioCallIntentHandling
Siri 1人以上の音声通信の要求 Contacts
    INStartVideoCallIntentt
INStartVideoCallIntentHandling
Siri 1人以上のビデオ通信を要求 Contacts
    INSearchCallHistoryIntent
INSearchCallHistoryIntentHandling
Siri 条件に一致するコールのリストを要求 CallType
Recipient
DateCreated
 Messaging INSendMessageIntent
INSendMessageIntentHandling
Siri クループまたは宛先を指定してメッセージを送信 Recipients
Content
GroupName
  INSearchForMessagesIntent
INSearchForMessagesIntentHandling
Siri 条件に一致するメッセージのリストを要求 Recipients
Senders
Attributes
DateTimeRange
GroupNames
  INSetMessageAttributeIntent
INSetMessageAttributeIntentHandling
Siri メッセージの属性変更 Attribute
 Photos INSearchForPhotosIntent
INSearchForPhotosIntentHandling
Siri 条件に一致する写真の検索 DateCreated
LocationCreated
PeopleInPhoto
AlbumName
  INStartPhotoPlaybackIntent
INStartPhotoPlaybackIntentHandling
Siri 写真のセットを検索してスライドショーを開始する DateCreated
LocationCreated
PeopleInPhoto
AlbumName
 Payments INSendPaymentIntent
INSendPaymentIntentHandling
Siri 現在のアカウントから別アカウントへの送金 Payee
CurrencyAmount
Note
  INRequestPaymentIntent
INRequestPaymentIntentHandling
Siri 別アカウントへの送金要求 Payer
CurrencyAmount
Note
 Workouts INStartWorkoutIntent
Siri ワークアウトの開始
  INPauseWorkoutIntent
INPauseWorkoutIntentHandling
Siri ワークアウトの一時停止 WorkoutName
  INResumeWorkoutIntent
INResumeWorkoutIntentHandling
Siri 一時停止中のワークアウトの再開 WorkoutName
  INEndWorkoutIntent
INEndWorkoutIntentHandling
Siri 現在のワークアウトを終了し、結果を保存する WorkoutName
  INCancelWorkoutIntent
INCancelWorkoutIntentHandling
Siri アクティブなワークアウトを取り消す WorkoutName
 Ride Booking INListRideOptionsIntent
INListRideOptionsIntentHandling
Maps 乗車予約サービスから利用可能な乗り物の種類を要求 PickupLocation
DropOffLocation
  INRequestRideIntent
INRequestRideIntentHandling
Siri,Maps 乗車要求に対してシステムが作成するインテント PickupLocation
DropOffLocation
PartySize
RideOptionName
  INGetRideStatusIntent
INGetRideStatusIntentHandling
Siri,Maps 以前に予約した乗車の現在の状態を要求 startSendingUpdates
stopSendingUpdates
 CarPlay INSetAudioSourceInCarIntent
INSetAudioSourceInCarIntentHandling
CarPlay (*1) CarPlay対応システムでのオーディオ再生のソースを変更 AudioSource
RelativeAudioSourceReference
  INSetClimateSettingsInCarIntent
INSetClimateSettingsInCarIntentHandling
CarPlay (*1) CarPlay対応車のエアコン設定の変更 EnableFan
EnableAirConditioner
EnableClimateControl
EnableAutoMode
AirCirculationMode
FanSpeedIndex
FanSpeedPercentage
RelativeFanSpeedSetting
Temperature
RelativeTemperatureSetting
ClimateZone
  INSetDefrosterSettingsInCarIntent
INSetDefrosterSettingsInCarIntentHandling
CarPlay (*1) CarPlay対応車で霜取り設定の変更 Enable
Defroster
  INSaveProfileInCarIntent
INSaveProfileInCarIntentHandling
CarPlay (*1) CarPlay対応の車両に自車両の環境設定を保存 ProfileNumber
  INSetProfileInCarIntent
INSetProfileInCarIntentHandling
CarPlay (*1) プロファイルから車両環境設定を変更 ProfileNumber
DefaultProfile
  INSetSeatSettingsInCarIntent
INSetSeatSettingsInCarIntentHandling
CarPlay (*1) CarPlay対応車の座席関連の設定を変更 EnableCooling
EnableHeating
EnableMassage
Seat
Level
RelativeLevelSetting
  INSetRadioStationIntent
INSetRadioStationIntentHandling
Siri 現在のラジオ局を変更 RadioType
Frequency
StationName
Channel
PresetNumber
Restaurant Reservations INBookRestaurantReservationIntent

Maps 指定レストランでの予約の作成を要求 Restaurant
BookingDateComponents
PartySize
Guest
GuestProvidedSpecialRequestText
INGetUserCurrentRestaurantReservation
BookingsIntent

INBookRestaurantReservationIntentHandling

Maps ユーザーの現在の予約のリストを要求 Restaurant
BookingDateComponents
PartySize
Guest
GuestProvidedSpecialRequestText
INGetAvailableRestaurantReservation
BookingDefaultsIntent

INGetAvailableRestaurantReservation
BookingDefaultsIntentHandling

Maps 潜在的な予約オプションをフェッチするときに使用するデフォルト値を要求 Restaurant
INGetAvailableRestaurantReservation
BookingsIntent

INGetAvailableRestaurantReservation
BookingsIntentHandling

Maps 予約可能なタイムスロットを要求 RestaurantForGetAvailable
RestaurantReservationBookings

PartySizeForGetAvailable
RestaurantReservationBookings

PreferredBookingDateComponents
ForGetAvailableRestaurantReservation
Bookings

INGetRestaurantGuestIntent
INGetRestaurantGuestIntentHandling

Maps 予約を行っているゲストについての情報を要求

※1 CarPlayとは、車に搭載されたiPhone用のデバイスで、iPhoneでしたいことを、車載ディスプレイから操作するこのです。上記の表のCarPlayとなっているものは、このデバイスで使用できるSiriの事です。
参考:Apple CarPlay

4 最後に

一覧しても、出来ることが限られている事には、なんら変わりは無いのですが、なんとなく漠然と「限られている」というよりは、少し理解が進んだように感じました。

5 参考にさせて頂いたリンク

Introducing SiriKit - WWDC 2016
Extending Your Apps with SiriKit - WWDC 2016
SiriKit Programming Guide Intents Domains
UnicornChat: Extending Your Apps with SiriKit