@@ -146,13 +146,18 @@ import StoreKit
146146 Task {
147147 do {
148148 // For subscription request, type must be .subs
149- let subscriptionOffer : SubscriptionOfferIOS ? = if let offer = offer {
150- SubscriptionOfferIOS (
151- id: offer [ " id " ] as? String ,
152- keyIdentifier: offer [ " keyIdentifier " ] as? String ,
153- nonce: ( offer [ " nonce " ] as? String ) . flatMap { UUID ( uuidString: $0) } ,
154- signature: offer [ " signature " ] as? String ,
155- timestamp: offer [ " timestamp " ] as? Int64 ?? 0
149+ let discountOffer : DiscountOfferInputIOS ? = if let offer = offer,
150+ let identifier = offer [ " identifier " ] as? String ,
151+ let keyIdentifier = offer [ " keyIdentifier " ] as? String ,
152+ let nonce = offer [ " nonce " ] as? String ,
153+ let signature = offer [ " signature " ] as? String ,
154+ let timestamp = offer [ " timestamp " ] as? Double {
155+ DiscountOfferInputIOS (
156+ identifier: identifier,
157+ keyIdentifier: keyIdentifier,
158+ nonce: nonce,
159+ signature: signature,
160+ timestamp: timestamp
156161 )
157162 } else {
158163 nil
@@ -162,11 +167,11 @@ import StoreKit
162167 andDangerouslyFinishTransactionAutomatically: nil ,
163168 appAccountToken: nil ,
164169 sku: sku,
165- withOffer: subscriptionOffer
170+ withOffer: discountOffer
166171 )
167172 let props = RequestPurchaseProps (
168173 request: . subscription(
169- RequestPurchasePropsByPlatforms ( android: nil , ios: iosProps)
174+ RequestSubscriptionPropsByPlatforms ( android: nil , ios: iosProps)
170175 ) ,
171176 type: . subs
172177 )
0 commit comments