high · M8 · MASVS-PLATFORM-3 · PTKD-AC-IAP-BYPASS-CODE
Hardcoded unlock or promo code
Paid features unlock with a code compared in the app. Unlocking with your own codes instead of App Store offer codes is an in-app purchase bypass, and anyone who reads the bundle finds the code.
How it is exploited
A user decompiles the JS bundle, finds `promoCode === "VIPFREE2026"` and posts it online. Everyone now has Pro for free, and Apple treats unlocking digital content with your own codes as bypassing In-App Purchase.
Why it matters
Lost revenue from a leaked code, and rejection or removal under 3.1.1.
How to fix it
- Remove codes compared in the app.
- Use App Store offer codes (presentOfferCodeRedeemSheet / Purchases.presentCodeRedemptionSheet) for promotions.
- If you need your own codes, validate them on your server and grant through a store-backed entitlement.
Does your app have this?
PTKD checks your build or your source project for PTKD-AC-IAP-BYPASS-CODE 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
- Purchases SDK configured with an empty or test key
- 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