Hi RevenueCat!
I am able to purchase packages without any issues, but I am having an issue when purchasing a package with a Subscription Offer.
I’ve tested with the following:
Xcode 14.0
macOS Monterey 12.6
iOS 15.5 & iOS 16.0
Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50)
RevenueCat 4.12.0, 4.11.0, 4.9.0, 4.8.0
I have tested using both a simulator via a debug store kit and on a device in Testflight, referencing the documentation provided here: https://www.revenuecat.com/docs/apple-app-store
Generated and uploaded the .p8 file with the issuer Id as described here:
https://www.revenuecat.com/docs/in-app-purchase-key-configuration
I followed the documentation here for implementation:
- https://www.revenuecat.com/docs/ios-subscription-offers
My RevenueCat is configured as follows:
let builder = Configuration.Builder(withAPIKey: <my_api_key>)
.with(usesStoreKit2IfAvailable: true)
.build()
Purchases.configure(with: builder)
My purchase code is as follows:
guard let promoOffer = await offer.storeProduct.eligiblePromotionalOffers().first else {
throw SubscriptionError.userNotEligibleForOffer
}
let info = try await Purchases.shared.purchase(package: offer, promotionalOffer: promoOffer)
The error I received is located in StoreKitError+Extensions, named invalidOfferSignature.
Purchase did not return a transaction: Error Domain=ASDServerErrorDomain Code=3903 "The server encountered an error"
ERROR: 😿‼️ The information associated with this PromotionalOffer is not valid.
userInfo: ["NSLocalizedDescription": "The information associated with this PromotionalOffer is not valid.\nSee https://rev.cat/ios-subscription-offers for more info.", "source_function": "invalidPromotionalOfferError(error:fileName:functionName:line:)", "readable_error_code": "INVALID_PROMOTIONAL_OFFER_ERROR", "source_file": "RevenueCat/ErrorUtils.swift:386", "NSUnderlyingError": StoreKit.Product.PurchaseError.invalidOfferSignature])
I’ve investigated the SignedData values using provided Apple documentation for SKPaymentDiscount:
- https://developer.apple.com/documentation/storekit/skpaymentdiscount
- https://developer.apple.com/documentation/storekit/in-app_purchase/original_api_for_in-app_purchase/subscriptions_and_offers/generating_a_signature_for_promotional_offers
I’ve verified the appBundleId, keyIdentifier, productIdentifier, and offerIdentifier are all correct when submitting the Subscription Offer. The timestamp is in the correct format of “UNIX epoch time format, in milliseconds”. The nonce and signature seem correct, but impossible to validate as these are both generated server side.
Let me know if any other information is needed. Thanks for the help!