Question

Unable to purchase package with Promotional Offer

  • 21 September 2022
  • 6 replies
  • 740 views

Badge +4

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!


6 replies

Badge

I’m seeing the same problem when I update RevenueCat from 4.10.1 to 4.13.4. When I now try to make a sandbox purchase of a subscription offer, it fails with an invalid offer signature error.

When I change the configuration to stop using StoreKit2 (usesStoreKit2IfAvailable: false), the purchase is successful.

Is there a change required to the in-app purchase key configuration in RevenueCat, so that it works with StoreKit2 when it has been working with StoreKit1?

https://www.revenuecat.com/docs/in-app-purchase-key-configuration

Userlevel 1
Badge +5

We’re experiencing the very same problem in a version where we just enabled StoreKit2, so Gary’s finding seems correct. 

 

We’ll disable StoreKit2 in our next release and hopefully have no more errors. 

 

Error Domain=NSYooshrIapErrorDomain Code=38 "(null)" UserInfo={NSUnderlyingError=0x2817fc120 {Error Domain=RevenueCat.ErrorCode Code=34 "The information associated with this PromotionalOffer is not valid. See https://rev.cat/ios-subscription-offers for more info." UserInfo={readable_error_code=INVALID_PROMOTIONAL_OFFER_ERROR, source_function=invalidPromotionalOfferError(error:fileName:functionName:line:), NSLocalizedDescription=The information associated with this PromotionalOffer is not valid. See https://rev.cat/ios-subscription-offers for more info., source_file=RevenueCat/ErrorUtils.swift:407, NSUnderlyingError=0x283af4a00 {Error Domain=StoreKit.Product.PurchaseError Code=6 "Unable to Complete Purchase"}}}}

Badge +5

Hi @philippe levieux 

We are experiencing the same issue. Have you been able to resolve the issue by disabling StoreKit2? 

Badge

I think the most recent version of the RevenueCat iOS SDK has StoreKit2 switched off by default. I’ve updated to 4.14.2 and successfully completed a sandbox purchase with a promotional offer.

Userlevel 1
Badge +5

 

Couple months later 🥳😅🙏🏻

System Specifications:

  • Xcode : 15
  • iPhone: XR
  • iOS: 16.3
  • MacOS: Sonoma 14.0
  • RevenueCat Pod Version: (4.25.6) Latest Pod
  • Language: Swift

 

Hi @RemoteDeveloper  @Gary @philippe levieux @Neybox Digital   any update on this issue?

@ryan I am testing on Real Device and after successfully purchasing Auto-Renewable Subscription I am trying to purchase a Promotional Offer and I am getting same error as below mentioned:

The information associated with this PromotionalOffer is not valid.

See https://rev.cat/ios-subscription-

offers for more info.

 

Please help me out of this issue. 

Reply