Class

INSearchForMessagesIntent

A request to list the messages matching the specified criteria.

Declaration

@interface INSearchForMessagesIntent : INIntent

Overview

Siri creates INSearchForMessagesIntent objects when the user asks to see already sent or received messages. You must implement this intent to support the reading of messages by Siri. This intent object contains the values for you to match when searching the user’s messages. Users can search for messages involving a specific person, messages sent or received on specific dates, or messages containing specific terms. When performing the search, use only the provided parameters and ignore any that have no values.

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

Additional Intent Attributes

Table 1 lists additional attributes of this intent object.

Table 1

Search messages intent attributes

Attribute

Description

Supported by

Siri Intents

Requires unlocked device

Yes, unless Show Previews is enabled on the user’s device.

Apps can optionally ask the user to unlock the device before handling this intent. To require unlocking of the device, include the name of this class in the IntentsRestrictedWhileLocked key of your Intents extension’s Info.plist file.

Example Phrases

Users can ask Siri to search for messages in a variety of ways. 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 messages

Locale

Example 1

Example 2

en

Find messages from Scott on <appName>

Read my <appName> messages from Heather

zh_CN

查找小李发来的<appName>消息

读一下来自李宏辉的<appName>信息

zh_HK

<appName>搵Jeffrey俾我嘅新訊息

讀吓微信來自陳嘉杰嘅訊息

zh_TW

幫我找<appName>上來自健行的新訊息

幫我用<appName>找來自John的短訊

yue_CN

<appName>揾Jeffrey俾我嘅新讯息

读吓微信来自陈嘉杰嘅讯息

ar

أوجد رسائل من رنا على <appName>

أوجد رسالة <appName> من محمد

da

find beskeder på <appName> fra John

find beskeder fra Bob på <appName>

de

Nach <appName> Nachrichten von Kitty suchen

Finde <appName> Nachrichten von Andreas

es

Búscame el mensaje de Julián en <appName>

Leer los mensajes de <appName> de Carlos

fi

Hae Petterin viestit <appName>ssa

Hae Karilta tulleet <appName> viestit

fr

Cherche les messages <appName> envoyés par John

Cherche les messages de John sur <appName>

he

תמצא הודעת <appName> מיוני

תקרא את ההודעת <appName> מדויד

it

Cerca messaggi da Tiziana su <appName>

Leggi i miei messaggi <appName> da Riccardo

ja

<appName>で正夫からのメッセージを探して

正夫から<appName>のメッセージ来てる

ko

내 새로운 <appName> 메시지를 읽어줘

나의 <appName> 메시지 읽어줘

ms

Cari semua teks dari Bob di <appName>

Paparkan semua mesej daripada Ahmad dalam <appName>

nb

Finn meldinger på <appName> fra Kitty

Les <appName> meldingene mine fra Jonas

nl

Vind berichten van Victor in <appName>

Lees mijn <appName> berichten van Sofie

pt

Encontra mensagens do João no <appName>

Leia minhas mensagens no <appName> da Maria

ru

Найди <appName> сообщение от Феди

Найти сообщения от Наташи в <appName>

sv

Hitta meddelanden från Hans på <appName>

Hitta <appName> meddelanden från Sandra

th

หาข้อความของสมชายที่ส่งมาใน <appName>

อ่านข้อความ <appName> จากสมหญิง

tr

Hasan'dan gelen <appName> mesajını bul

Hasan'dan gelen <appName> mesajını göster

In Table 2, <appName> represents the name of the app whose Intents extension searches the user’s messages. If your app uses custom names for contacts, you can tell Siri about those names using the INVocabulary class.

Topics

Creating the Intent Object

Getting the Senders and Recipients

recipients

The contacts who are the recipients of the messages.

recipientsOperator

The operator that defines how to use the recipients in the search criteria.

senders

The senders of the messages searched for.

sendersOperator

The operator that defines how to use the senders in the search criteria.

speakableGroupNames

The names of any groups associated with the message.

speakableGroupNamesOperator

The operator that defines how to use the group names in the search criteria.

Getting the Search Criteria

searchTerms

The terms to look for in the messages.

searchTermsOperator

The operator that defines how to use the set of terms in the search criteria.

dateTimeRange

The range of dates in which to search for messages.

attributes

The attributes that must be present on a message to yield a match.

Specifying Message Identifiers

identifiers

The message identifiers to locate in your search.

identifiersOperator

The operator that defines how to use the identifiers in the search criteria.

conversationIdentifiers

The conversation identifiers to locate in your search.

conversationIdentifiersOperator

The operator that defines how to use the conversation identifiers in the search criteria.

notificationIdentifiers

The notification identifiers to locate in your search.

notificationIdentifiersOperator

The operator that defines how to use the notification identifiers in the search criteria.

Deprecated Symbols

- initWithRecipients:senders:searchTerms:attributes:dateTimeRange:identifiers:notificationIdentifiers:speakableGroupNames:

Initializes a search messages intent object with the specified search criteria.

Deprecated
- initWithRecipients:senders:searchTerms:attributes:dateTimeRange:identifiers:notificationIdentifiers:groupNames:

Initializes a search messages intent object with the specified search criteria.

Deprecated
groupNames

The names of any groups associated with the message.

Deprecated
groupNamesOperator

The operator that defines how to use the group names in the search criteria.

Deprecated

Relationships

Inherits From

See Also

Search for Messages

INSearchForMessagesIntentHandling

An interface that handles requests to search the current user’s messages.

INSearchForMessagesIntentResponse

Your app’s response to a search for messages intent.