Skip to content

StoreKit 2 - Promotional Offers - .invalidOfferSignature error. Can't purchase any offer.  #2114

Description

@roboqo

Describe the bug
Our RevenueCat SDK is configured like this and usesStoreKit2IfAvailable is set to false

Purchases.configure(
    with: Configuration.Builder(withAPIKey: "MY_KEY")
        .with(usesStoreKit2IfAvailable: false)
        .build()
)

Then we did implemented Promotional Offers feature following steps described in RC: iOS Subscription Offers

Basically:

let product = somePackage.storeProduct
guard let discount = product.discounts.first else {
    throw PurchaseError.promotionalOfferNotFound
}

let promotionalOffer = try await Purchases.shared.promotionalOffer(forProductDiscount: discount, product: product)

// All good here, presenting offer UI

// Purchasing using code below:

Purchases.shared.purchase(
    product: product,
    promotionalOffer: promotionalOffer,
    completion: responseHandler
)

All worked fine, we have this in production app and all is good there. But, we want to move to StoreKit 2 and by just changing our SDK configuration code to:

Purchases.configure(
    with: Configuration.Builder(withAPIKey: "MY_KEY")
        .with(usesStoreKit2IfAvailable: true)
        .build()
)

That is setting usesStoreKit2IfAvailable to true - we can't purchase ANY promotional offer, always getting the same error:

[Purchases] - ERROR: 😿‼️ The information associated with this PromotionalOffer is not valid. See https://rev.cat/ios-subscription-offers for more info.
[Purchases] - ERROR: 💰 Product purchase for 'PRODUCT_IDENTIFIER_HERE' failed with error: PurchasesError(error: 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:)", "NSUnderlyingError": StoreKit.Product.PurchaseError.invalidOfferSignature, "source_file": "RevenueCat/ErrorUtils.swift:413", "NSLocalizedDescription": "The information associated with this PromotionalOffer is not valid.\nSee https://rev.cat/ios-subscription-offers for more info."])

App sheet 1

Error

  1. Environment
    1. Platform: iOS
    2. SDK version: 4.15.0
    3. StoreKit 2 (disabled with useStoreKit2IfEnabled(false)) (Y/N): Y
    4. OS version: 16.1.1
    5. Xcode version: 14.1
    6. How widespread is the issue. Percentage of devices affected.
  2. The same problem is with older SDK version - Promotional Offers works fine with SK1, but we always get the same error after enabling SK2

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions