SDK error · code 34

invalidPromotionalOfferError (error code 34): Invalid promotional offer

What it means

invalidPromotionalOfferError (code 34) means Apple rejected a promotional offer on iOS: the signature is invalid, the offer identifier is wrong or inactive, the price is no longer valid, or parameters are missing. The server signs the offer with your In-App Purchase key. Check the key, the offer in App Store Connect, and the offer identifier, then try again.

Code

34

iOS (Swift)

ErrorCode.invalidPromotionalOfferError

Android (Kotlin)

No matching code in the Android SDK; see the causes below.

Causes

Why the SDK returns invalidPromotionalOfferError

Fix

How to fix invalidPromotionalOfferError

  1. 01

    Check the In-App Purchase key

    Confirm the app has the key ID, issuer ID and private key of a current In-App Purchase key. See invalidAppleSubscriptionKeyError.

  2. 02

    Check the offer in App Store Connect

    Confirm the promotional offer exists, is active and has a valid price for the storefront. Apple explains the setup in Implementing promotional offers.

  3. 03

    Use the SDK's offer objects

    Get the offer from getPromotionalOffer or eligiblePromotionalOffers(forProduct:) and pass that object to purchase. Do not build the signature by hand.

  4. 04

    Sign in with the same app user

    The signature is tied to the app user. Do not change the app user ID between asking for the offer and buying.

In your app

How to handle it in code

  • Do not retry the same offer. A bad signature or identifier fails again.
  • Fall back to the regular price, and alert yourself. This is a setup problem.
  • Do not grant access, and do not apply the discount yourself.
Match the errorSwift
// Swift
do {
  let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .invalidPromotionalOfferError {
  // handle invalid promotional offer
}

On RevenueDot: POST /v1/offers signs each requested offer with the app's In-App Purchase key and the app user's account token. With no key it answers 400 with code 7234 and fails only that offer. The server cannot check an offer against Apple, so Apple's rejection shows up on the device as this error.

FAQ

invalidPromotionalOfferError: questions people ask

What causes an invalid promotional offer signature?

A key that is not the app's current In-App Purchase key, an offer identifier that is not active, or a signature made for another app user. Apple reports it as invalidSignature or invalidOfferSignature.

How do I test promotional offers?

Use a sandbox account on a real device with the In-App Purchase key configured on the server. For StoreKit 1 promotional offers the SDK needs an existing purchase on the device.

How do I check for invalidPromotionalOfferError in React Native and Flutter?

In React Native, compare error.code with PURCHASES_ERROR_CODE.INVALID_PROMOTIONAL_OFFER_ERROR. In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.invalidPromotionalOfferError.

Get started

Keep the RevenueCat SDK. Change the backend.

RevenueDot answers the same SDK calls with the same error codes. Start free on RevenueDot Cloud, free up to $10,000 a month in tracked revenue.

Already have an account? Sign in · Prefer your own servers? Self-host free