---
title: "subscriptionIntroductoryOffer(applyOffer:compactJWS:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/subscriptionintroductoryoffer(applyoffer:compactjws:)"
---

# subscriptionIntroductoryOffer(applyOffer:compactJWS:)

Selects the introductory offer eligibility preference to apply to a purchase a customer makes from a subscription store view.

## Declaration

```swift
nonisolated func subscriptionIntroductoryOffer(applyOffer: @escaping (Product, Product.SubscriptionInfo) -> Bool, compactJWS: @escaping (Product, Product.SubscriptionInfo) async throws -> String) -> some View

```

## Parameters

- `applyOffer`: The system calls this function before drawing the given subscription product on the subscription store view. Return if the introductory offer should be applied to a given 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. Return a compact JWS signature you generate on your server that validates the selected offer eligibility preference. 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 introductory subscription offers 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, instead use SubscriptionStoreView. Determine if the introductory offer should be displayed in the view and applied to the purchase using the applyOffer. If the signature passes validation, the system applies or removes the offer to the purchases according to the offer eligibility preference. If the signature fails validation, the purchase will fail with Product.PurchaseError.invalidOfferSignature.

## 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)
