presentOfferCodeRedeemSheet(in:)
Displays a sheet in the window scene that enables customers to redeem an offer code that you configure in App Store Connect.
Declaration
@MainActor static func presentOfferCodeRedeemSheet(in scene: UIWindowScene) async throwsParameters
- scene:
The Uiwindowscene that StoreKit uses to display the offer code redemption sheet.
Mentioned in
Discussion
The presentOfferCodeRedeemSheet(in:) method displays a system sheet in the window scene, where customers can enter and redeem offer codes. If you generate offer codes in App Store Connect, call this function to enable customers to redeem the offer. To display the sheet using SwiftUI, see offerCodeRedemption(isPresented:onCompletion:).
For more information on offer codes, see Supporting offer codes in your app.
When customers redeem an offer code, StoreKit emits the resulting transaction in updates. Set up a transaction listener as soon as your app launches to receive new transactions while the app is running. For more information, see updates.
In Mac apps built with Mac Catalyst, this method throws a StoreKitError.unknown error.