---
title: "subscriptionPromotionalOffer(offer:compactJWS:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/subscriptionpromotionaloffer(offer:compactjws:)"
---

# subscriptionPromotionalOffer(offer:compactJWS:)

Selects a promotional offer to apply to a purchase a customer makes from a subscription store view.

## Declaration

```swift
nonisolated func subscriptionPromotionalOffer(offer: @escaping (Product, Product.SubscriptionInfo) -> Product.SubscriptionOffer?, compactJWS: @escaping (Product, Product.SubscriptionInfo, Product.SubscriptionOffer) async throws -> String) -> some View

```

## Parameters

- `offer`: The system calls this function before drawing the given subscription product on the subscription store view. Return the promotional offer to apply to the product, if any, to have system-provided UI reflect the discounted terms under the selected offer.
- `compactJWS`: The system calls this function before processing a purchase, with the product to be purchased provided as a parameter, along with the selected subscription offer to be applied to the purchase. Return a compact JWS signature you generate on your server that validates the selected offer. Errors thrown from this closure will be surfaced via the doc://com.apple.SwiftUI/documentation/SwiftUI/View/onInAppPurchaseCompletion(perform:) modifier. For information about generating the JWS signature, see doc://com.apple.documentation/documentation/StoreKit/generating-jws-to-sign-app-store-requests..

## Discussion

Discussion Subscription stores within this view uses the specified subscription offer to configure the appearance of the subscription plans displayed, when you use a system-provided SubscriptionStoreControlStyle to style the in-app subscription store. Standard ProductViewStyle instances don’t show introductory or promotional offers in UI. Use the SubscriptionStoreView instead to show these offers in the UI. If the signature passes validation for the offer you select, the system applies the offer to the purchase. If the signature fails validation for the offer you select, the purchase fails with Product.PurchaseError.invalidOfferSignature. Promotional offers you select in this modifier overwrite any offers you specified in ancestor views.

## See Also

### Interacting with the App Store and Apple Music

- [appStoreOverlay(isPresented:configuration:)](swiftui/view/appstoreoverlay(ispresented:configuration:).md)
- [manageSubscriptionsSheet(isPresented:)](swiftui/view/managesubscriptionssheet(ispresented:).md)
- [refundRequestSheet(for:isPresented:onDismiss:)](swiftui/view/refundrequestsheet(for:ispresented:ondismiss:).md)
- [offerCodeRedemption(options:isPresented:onCompletion:)](swiftui/view/offercoderedemption(options:ispresented:oncompletion:).md)
- [musicPicker(isPresented:title:selection:)](swiftui/view/musicpicker(ispresented:title:selection:).md)
- [musicSubscriptionOffer(isPresented:options:onLoadCompletion:)](swiftui/view/musicsubscriptionoffer(ispresented:options:onloadcompletion:).md)
- [currentEntitlementTask(for:priority:action:)](swiftui/view/currententitlementtask(for:priority:action:).md)
- [inAppPurchaseOptions(_:)](swiftui/view/inapppurchaseoptions(_:).md)
- [manageSubscriptionsSheet(isPresented:subscriptionGroupID:)](swiftui/view/managesubscriptionssheet(ispresented:subscriptiongroupid:).md)
- [onInAppPurchaseCompletion(perform:)](swiftui/view/oninapppurchasecompletion(perform:).md)
- [onInAppPurchaseStart(perform:)](swiftui/view/oninapppurchasestart(perform:).md)
- [productIconBorder()](swiftui/view/producticonborder().md)
- [productViewStyle(_:)](swiftui/view/productviewstyle(_:).md)
- [productDescription(_:)](swiftui/view/productdescription(_:).md)
- [storeButton(_:for:)](swiftui/view/storebutton(_:for:).md)
