Class

INUpdateMediaAffinityIntent

A request to update the user’s affinity for a media item.

Declaration

class INUpdateMediaAffinityIntent : INIntent

Overview

Siri creates an INUpdateMediaAffinityIntent object when the user asks to update the affinity for a media item. The intent object contains the media to update.

To handle this intent, the handler object in your Intents extension must adopt the INUpdateMediaAffinityIntentHandling protocol. Your handler should confirm the request and create an INUpdateMediaAffinityIntentResponse object with the media to update.

Additional Intent Attributes

Table 1 lists additional attributes of this intent object.

Table 1

Update affinity intent attributes

Attribute

Description

Supported by

Siri Intents (audio only)

Always requires unlocked device

No

Example Phrases

Users can ask Siri to search for media 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 isn’t exhaustive and Siri may recognize many other phrases.

Table 2

Siri phrases that trigger updating the affinity for a media item

Locale

Example 1

Example 2

en

I don’t like this song.

Tell <appName> that I love pop music

zh_CN

我不喜欢这首歌

告诉<appName>我喜欢流行音乐

zh_HK

我唔鍾意呢首歌

話比<appName>知我鍾意流行音樂

zh_TW

我不喜歡這一首歌

告訴<appName>我喜歡流行音樂

yue_CN

我唔钟意呢首歌

话比<appName>知我钟意流行音乐

ar

لا أحب هذه الأغنية

da

Jeg kan ikke lide denne sang

Fortæl <appName> at jeg elsker pop musik

de

Mir gefällt das Lied nicht

Sag <appName> dass ich Pop Musik liebe

es

No me gusta esta canción

Dile a <appName> que me gusta la música pop

fi

En pidä tästä kappaleesta

Kerro <appName> että pidän popista

fr

Je n'aime pas cette chanson

Dis à <appName> que j'aime la musique pop

he

אני לא אוהב את השיר הזה

תגידי ל-<appName> שאני אוהב מוזיקת פופ

it

Non mi piace questa canzone

Di' a <appName> che amo la musica pop

ja

この曲は好きじゃない

<appName> にポップミュージックが好きだと教えて

ko

이 노래 싫어

<appName>에 팝 음악 좋아해 라고 말해

ms

Saya tak suka lagu ini

Beritahu <appName> saya suka muzik pop

nb

Jeg liker ikke denne sangen

Fortell <appName> at jeg elsker popmusikk

nl

Ik vind dit geen leuk nummer

Zeg <appName> dat ik hou van popmuziek

pt

Eu não gosto desta música

Diga ao <appName> que eu amo música pop.

ru

Мне не нравится эта песня

сказать Yandex Music что мне нравится поп музыка

sv

Jag gillar inte denna sången

th

ฉันไม่ชอบเพลงนี้

บอก <appName> ว่าฉันชอบเพลงป๊อบ

tr

Bu şarkıyı sevmedim

<appName>'e söyle pop müzik seviyorum

In Table 2, <appName> represents the name of the app whose Intents extension handles the request.

Topics

Initializing the Intent Object

init(mediaItems: [INMediaItem]?, mediaSearch: INMediaSearch?, affinityType: INMediaAffinityType)

Creates an intent that describes the media items, their location, and the affinity to update.

Getting the Media Information

var affinityType: INMediaAffinityType

The user’s affinity for the media item.

enum INMediaAffinityType

Constants that describe a user’s affinity for a media item.

var mediaItems: [INMediaItem]?

The media items to update.

var mediaSearch: INMediaSearch?

The type of item to search for.

Relationships

Inherits From

Conforms To

See Also

Update Media Affinity

protocol INUpdateMediaAffinityIntentHandling

The interface that handles requests to update the user’s preference for a media item.

Beta
class INUpdateMediaAffinityIntentResponse

Your app’s response to an update media affinity intent.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software