---
title: "updateProductVisibility(_:for:)"
framework: storekit
role: symbol
role_heading: Type Method
path: "storekit/product/promotioninfo/updateproductvisibility(_:for:)"
---

# updateProductVisibility(_:for:)

Updates a value that indicates whether a promoted in-app purchase appears in the App Store on the user’s device.

## Declaration

```swift
static func updateProductVisibility(_ visibility: Product.PromotionInfo.Visibility, for productID: Product.ID) async throws
```

## Parameters

- `visibility`: A visibility value of doc://com.apple.storekit/documentation/StoreKit/Product/PromotionInfo/Visibility-swift.enum that determines whether a promoted in-app purchase appears in the App Store on the user’s device.
- `productID`: The product identifier of the promoted in-app purchase.

## Mentioned in

Supporting promoted In-App Purchases in your app

## Discussion

Discussion Call this method to change the visibility setting for a promoted in-app purchase. Changes take effect after you call this method. The following code example updates a promoted product’s visibility after the user purchases it. The purchased product is hidden to avoid showing it again on the device. // Update visibility to hide a promoted product after the user purchases it. let purchasedProductIdentifier = "com.example.ExampleApp.product1"

do {   try await Product.PromotionInfo.updateProductVisibility(.hidden, for: purchasedProductIdentifier) } catch {   <#Handle Error#> }

## See Also

### Managing promotion visibility

- [visibility](storekit/product/promotioninfo/visibility-swift.property.md)
- [Product.PromotionInfo.Visibility](storekit/product/promotioninfo/visibility-swift.enum.md)
