Contents

resolveMediaItems(for:with:)

Resolves the media items to add.

Declaration

optional func resolveMediaItems(for intent: INAddMediaIntent, with completion: @escaping  @Sendable ([INAddMediaMediaItemResolutionResult]) -> Void)
optional func resolveMediaItems(for intent: INAddMediaIntent) async -> [INAddMediaMediaItemResolutionResult]

Parameters

  • intent:

    The intent object that contain details about the user’s request. Use this object to get the initial information, if any, provided by the user.

  • 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 add. Always strive toward a successful resolution to the specific media items, but feel free to ask for confirmation of the selected media items if there’s some uncertainty about whether you are adding the correct media items.

If you find multiple media items matching the same name, consider asking the user to disambiguate from among the most likely candidates.

See Also

Resolving Details of the Intent