Code
34
SDK error · code 34
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.invalid
Android (Kotlin)
No matching code in the Android SDK; see the causes below.
Causes
invalidSignature (the signature in a payment discount is not valid), invalidOfferIdentifier (the identifier cannot be found or is not active), invalidOfferPrice (the price set in App Store Connect is no longer valid) and missingOfferParams (source).Product.PurchaseError cases invalidOfferSignature, invalidOfferIdentifier, invalidOfferPrice and missingOfferParameters.Fix
Confirm the app has the key ID, issuer ID and private key of a current In-App Purchase key. See invalidAppleSubscriptionKeyError.
Confirm the promotional offer exists, is active and has a valid price for the storefront. Apple explains the setup in Implementing promotional offers.
Get the offer from getPromotionalOffer or eligiblePromotionalOffers(forProduct:) and pass that object to purchase. Do not build the signature by hand.
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
// 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
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.
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.
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
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