resolveMediaItems(for:with:)
Resolves the media items to play.
Declaration
optional func resolveMediaItems(for intent: INPlayMediaIntent, with completion: @escaping @Sendable ([INPlayMediaMediaItemResolutionResult]) -> Void)optional func resolveMediaItems(for intent: INPlayMediaIntent) async -> [INPlayMediaMediaItemResolutionResult]Parameters
- intent:
The object that contains details about the user’s request. Use this object to get any initial information the user may have provided.
- completion:
The block to execute with the resolution. You must execute this block while implementing this method. This block has no return value and takes the following parameter:
- resolutionResult
The object that contains the details of your proposed resolution.
Discussion
Implement this method to resolve the media items to play. If your app isn’t completely sure of the match, return a few results with the best match first. The system can start playing the first item and offer the alternatives in case the user wants to play one of them instead.