high · M8 · MASVS-PLATFORM-3 · PTKD-AC-IAP-KEY-EMPTY
Purchases SDK configured with an empty or test key
The in-app purchase SDK (RevenueCat style) is configured with an empty API key or a test_ key. In the release build purchases then fail or hit a test store, which is what the reviewer sees.
How it is exploited
Not an attack: Purchases.configure({ apiKey: '' }) was left from the template (or a test_ key ships). The reviewer taps Subscribe, nothing loads or a test store appears, and the review stops.
Why it matters
Rejection under 2.1 (the purchase does not work), and every real user who tries to pay fails until the next update.
How to fix it
- Put the production public key (RevenueCat: appl_..., goog_...) in the release build configuration, for example an EAS or CI release profile.
- Fail loudly in development when the key is empty, so it cannot slip into a release.
- Before submitting, buy once in a TestFlight build with a sandbox account.
TypeScript
const extra = Constants.expoConfig?.extra ?? {}; // set per EAS build profile
const key: string | undefined = Platform.OS === "ios" ? extra.rcIosKey : extra.rcAndroidKey;
if (!key || key.startsWith("test_")) {
if (__DEV__) throw new Error("RevenueCat key missing or a test key");
}
Purchases.configure({ apiKey: key! });Does your app have this?
PTKD checks your build or your source project for PTKD-AC-IAP-KEY-EMPTY and every other check in this knowledge base.
Scan your appReferences
Related checks (M8)
- JavaScript obfuscation in the build
- Export compliance (ITSAppUsesNonExemptEncryption) not declared
- HealthKit app that also ships an ads SDK
- Hardcoded unlock or promo code
- Purchase screen falls back to made-up prices or 'coming soon' text
- False-urgency copy on a purchase screen
- Hardcoded price on a purchase screen
- Free trial without the price it converts to