Introducing ReceiptParser for Apple Platforms
Blog post from RevenueCat
Receipts in iOS apps provide a complete record of a user's in-app purchase history and are typically sent to Apple's /verifyReceipt endpoint for verification, although direct device verification is discouraged due to security risks. Apple introduced StoreKit 2, offering new APIs that enable devices to extract purchase information more securely, while older methods using Bundle.appStoreReceiptURL remain available for compatibility with iOS versions before 15.0. Receipts are complex binary files encoded with ASN.1, a standard that structures data in a hierarchical format using Tag-Length-Value (TLV) triplets. RevenueCat has developed a ReceiptParser within its SDK to simplify receipt processing, now accessible as a standalone Swift Package for parsing and extracting purchase information. The parser enables developers to handle receipts without relying on Apple's endpoint, though the receipt contents should not be fully trusted without server-side validation. The ReceiptParser aids developers in debugging and verifying subscription statuses by providing a detailed API for interpreting receipt contents, which can be utilized directly within Xcode.