iQIYI SiriKit Media Intents and Siri Suggestions Integration Guide
The guide explains how iQIYI integrates SiriKit Media Intents and Siri Suggestions on iOS 13, covering extension setup, intent handling (resolve, confirm, handle), playback response codes, shortcut donation via NSUserActivity or Intents, and best practices for media search and background UI.
The article introduces the background of Apple’s Worldwide Developers Conference (WWDC) and the evolution of SiriKit since its debut at WWDC 2016, highlighting iQIYI’s research and implementation of SiriKit Media Intents and Siri Suggestions for iOS 13.
SiriKit Overview : SiriKit provides two frameworks – Intents and IntentsUI – and supports two extension types: Intents app extension (processes user requests) and Intents UI app extension (custom UI without touch events).
Media Domain : The Media domain handles four intent types – play media, add media, search media, and media preferences. Users can invoke media playback without launching the app (audio) or with the app in the foreground (video).
iQIYI Media Playback Intent Integration Process :
Configure the extension target to support INPlayMediaIntent and select appropriate Media Categories.
Add the intent class name to the App Target’s Info.plist under NSUserActivityTypes for foreground playback.
Provide example phrases for each intent to avoid App Store warnings.
Optionally set an app alias in Info.plist to improve Siri’s name recognition.
Handling Requests :
Resolve : Validate intent parameters (e.g., resolve INMediaSearch objects).
Confirm : Final verification that the app can fulfill the intent (often omitted for media intents to improve conversion).
Handle : Execute the intent and return a response code.
Response codes differ for audio and video:
Audio playback: INPlayMediaIntentResponseCodeHandleInApp Video playback: INPlayMediaIntentResponseCodeContinueInApp The app receives system callbacks:
Background playback: application:handleIntent:completionHandler: Foreground playback: application:continueUserActivity:restorationHandler: Media Search Intent Integration : Supports only foreground display of search results. The flow includes Resolve (extract search query) and Handle (return INSearchForMediaIntentResponseCodeContinueInApp).
Siri Suggestions :
Two suggestion types: frequent‑function suggestions (implemented via NSUserActivity) and media‑playback suggestions (implemented via INPlayMediaIntent and INUpcomingMediaManager).
Developers must donate shortcuts by reporting activity to Siri; Siri learns patterns to surface suggestions.
Shortcut Donation and Removal :
Donate using NSUserActivity (set requiredUserInfoKeys, persistentIdentifier) or Intents (define groupIdentifier).
Remove donations when the shortcut is no longer supported or the user deletes it.
Implementation Tips :
Prefer built‑in intents from Siri Domains before creating custom intents.
Use Intents UI app extension for background shortcuts that need custom UI.
Conclusion : SiriKit still has optimization opportunities, such as presenting a list of apps when a user requests media without specifying an app. Developers can refer to Apple’s documentation and WWDC videos for deeper guidance.
References:
SiriKit Documentation
Introduction to Siri Shortcuts (WWDC 2018)
Introducing Parameters for Shortcuts (WWDC 2019)
Introducing SiriKit Media Intents (WWDC 2019)
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
