<!--
{
  "availability" : [
    "iOS: 9.3.0 -",
    "iPadOS: 9.3.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPMediaPlaylist/addItem(withProductID:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPMediaPlaylist(im)addItemWithProductID:completionHandler:"
  },
  "title" : "addItem(withProductID:completionHandler:)"
}
-->

# addItem(withProductID:completionHandler:)

Adds the item associated with the product identifier to the end of the playlist.

```
func addItem(withProductID productID: String, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
```

## Parameters

`productID`

The product identifier for the item to add.

`completionHandler`

A block that the system calls after it adds the item to the playlist.

- error: If an error occurred, this parameter holds the error object that explains the error. Otherwise, the value of this parameter is <doc://com.apple.documentation/documentation/ObjectiveC/nil-227m0>.

## Discussion

The method adds a single media item associated with the product identifier to the playlist.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)