Possible Phrases For 3rd Party Apps
Tell <MyApp> that I love pop musicPlay Khalid on <MyApp>I don't like this songAdd this to my library
Intents
INPlayMediaIntentto allow playing audioINAddMediaIntentto add media items to playlists and librariesINUpdateMediaAffinitiyIntentto express affinity to media itemsINSearchForMediaIntentto search for specific media in your appSupport for playback controls let users say
Play Billie Eilish shuffled in <MyApp>Supported audio types:
Music,Podcasts,Audiobooks,RadioEven search for unsupported media types possible
caveat: search queries will be untyped
Handling SiriKit Media Requests
Handling requests through Siri app extension
Don’t forget to add the Siri capability to your app
Request processing involves
Resolve>Confirm>HandleSee 10:15 or an extensive example about
Adding intents to your app,Specify supported intents and media types,Implement resolve, handle for INPlayMediaIntent and INAddMediaIntent
Best Practices
If Siri support already added:
The new API uses existing code for handling background app launch
You need to add resolve methods
You need to update intents extension with supported media types
Apple Watch
Foreground app launch via
INPLayMediaIntentResponseCode.continueInAppIntent is handled by your
WKExtensionDelegatePrefer on-device cache in your resolve method - only use network if absoloutey necessary
Process results in resolve method
case insesnitivebecaue Siri might give you upper case resultsWrite an effective search method - be flexiblesinceSiri might understand certain media types, e.g.
videoifvideois part of what the user searchesSiri might understand
sunorson
Always populate
title,artistandtypein the returnedINMediaItemsince they all influence Siri’s outputHandle error cases gracefully
Most common error is not found:
INPlayMediaMediaItemResolutionResult(InMediaItemResolutionResult.unsupported())List of possible errors in
INPlayMediaMediaItemUnsupportedReason
When you support playback controls in your app also support them in Siri
Play <Song> on repeat in <MyApp>Play <Playlist> on shuffle in <MyApp>Resume <Podcast> at double speed in <MyApp>Play <Artist> in <MyApp> next|later
User says
Play <MyApp>Don’t ask what to play!
Choose something interesting automatically or resume the queue
User vocabulary helps Siri recognize important named entities
Global vocabulary is appropriate for global app terms
