<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/subscriptionIntroductoryOffer(applyOffer:compactJWS:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewP010_StoreKit_aB0E29subscriptionIntroductoryOffer05applyH010compactJWSQrSb0dE07ProductV_AJ16SubscriptionInfoVtc_SSAJ_ALtYaKctF"
  },
  "title" : "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.

```
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
[`onInAppPurchaseCompletion(perform:)`](/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

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
<doc://com.apple.documentation/documentation/StoreKit/SubscriptionStoreControlStyle>
to style the in-app subscription store. Standard
<doc://com.apple.documentation/documentation/StoreKit/ProductViewStyle>
instances don’t show introductory or promotional offers in UI, instead use
<doc://com.apple.documentation/documentation/StoreKit/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
<doc://com.apple.documentation/documentation/StoreKit/Product/PurchaseError/invalidOfferSignature>.

---

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)