Class

INSearchForPhotosIntent

Requests a list of photos that match the specified criteria.

Overview

The system creates an INSearchForPhotosIntent object when the user asks to search for photos in an app. The intent object contains the parameters to use during the search, including the possible name of a photo album, the people in the photos, or the location of the photos. Use this intent object to validate the search parameters and to begin the search process. When performing the search, use only the parameters that were provided and ignore any that have no values.

To handle this intent, the handler object in your Intents extension must adopt the INSearchForPhotosIntentHandling protocol. Your handler should confirm the request and create an INSearchForPhotosIntentResponse object with the results of the search. For successful searches, Siri offers the user a way to launch your app and see the results.

For a list of other intents in the photos domain, see INPhotosDomainHandling.

Additional Intent Attributes

Table 1 lists additional attributes of this intent object.

Table 1

Photo search intent attributes

Attribute

Description

Supported by

Siri

Always requires unlocked device

Yes

Example Phrases

There are many ways in which users can ask Siri to search for photos. Table 2 provides a few sample phrases in different languages. You can use these phrases during testing to trigger your intents. This list is not exhaustive and Siri may recognize many other phrases.

Table 2

Siri phrases that trigger the searching of photos

Locale

Example 1

Example 2

en

Look for beach photos taken last summer in <appName>

zh_CN

打开<appName>给我看上周末拍的照片

zh_HK

<appName>搵吓上個禮拜影嘅相

zh_TW

<appName>找上週末拍的照片

yue_CN

去<appName>揾吓上个礼拜影嘅相

ar

مستعملا <appName> اعثر على صور أشجار

da

åben beans og vis mig billeder jeg tog på island sidste måned

vis mig billeder jeg tog i sidste weekend på island med photos proto

de

Suche Fotos vom Strand von letztem Sommer in <appName>

Suche meine Fotos aus Tokio auf <appName>

es

Muéstrame las fotos que tomé en la playa el verano pasado usando <appName>

Busca mis fotos de Tokio en <appName>

fi

Etsi viime kesänä otettuja rantakuvia <appName>ssa

Hae <appName>n rantakuvia eiliseltä

fr

affiche-moi les photos de plages de l'été dernier que j'ai prises avec <appName>

Montre-moi avec <appName> les photos de l'année dernière de la plage

he

באמצעות <appName> תראה לי תמונות שצילמתי שבוע שעבר בסן חוזה

באמצעות <appName> תראה את אלבום התמונות הוואי

it

Cerca foto sulla spiaggia scattate la scorsa estate in <appName>

ja

<appName>で去年の夏に撮った写真を探して

去年の夏に撮った写真を<appName>で見せて

ko

<appName>에서 작년에 찍은 해변 사진 찾아줘

<appName>에서 올해 찍은 공원 사진 찾아줘

ms

Cari gambar yang saya ambil di Malaysia pada bulan ini dalam <appName>

Tunjukkan foto yang saya ambil minggu lepas di KLCC dengan <appName>

nb

Finn bilder av strender fra i fjor i <appName>

nl

Zoek naar strand foto's die vorige zomer zijn genomen in <appName>

pt

Procure fotos de praia que tirei semana passada no <appName>

Acha as fotos de ontem à noite usando <appName>

ru

С помощью <appName> покажи мне фотографии которые я сделала в Санкт Петербурге на прошлой неделе

Покажи мне фотографии которые я сделал на прошлых выходных в Исландии с помощью <appName>

sv

Använd <appName> och visa mig strandbilder från förra veckan

Öppna <appName> och visa mig bilder på hundar som jag tog förra månaden

th

แสดงรูปที่ฉันถ่ายเมื่อสัปดาห์ที่แล้วที่ San Jose ใน <appName>

tr

İstanbul'da geçen hafta <appName>'la çektiğim fotoğrafları göster

<appName> kullanarak İstanbul'da geçen hafta çektiğim fotoğrafları göster

In the preceding examples, <appName> represents the name of the app whose Intents extension initiates the search. If your app uses custom photo album names, photo tags, or contact names, you can tell Siri about those names using the INVocabulary class.

Topics

Getting the People in the Photos

var peopleInPhoto: [INPerson]?

The users in the photos.

var peopleInPhotoOperator: INConditionalOperator

The operator that defines how to search for people in the photos.

Getting the Search Terms

var searchTerms: [String]?

An array of terms to look for in the photos.

var searchTermsOperator: INConditionalOperator

The operator that defines how to incorporate the search terms when performing the search.

Getting the Search Attributes

var dateCreated: INDateComponentsRange?

The range of dates during which the photos were taken.

var locationCreated: CLPlacemark?

The location where the photos were taken.

var albumName: String?

The name of the album that contains the photos.

var includedAttributes: INPhotoAttributeOptions

The attributes that must be present in the photos.

var excludedAttributes: INPhotoAttributeOptions

The attributes that must not be present in the photos.

struct INPhotoAttributeOptions

Constants indicating attributes of a photo.

Relationships

Inherits From

Conforms To

See Also

Search for Photos

Searching for Photos

Use SiriKit to search for photos managed by your app.

protocol INSearchForPhotosIntentHandling

Handles the searching of the user’s photos.

class INSearchForPhotosIntentResponse

Contains your app’s response to a search for photos intent.