Use this page with AI
Copy this into your coding assistant and add your request.
Read https://openiap.dev/docs/apis/ios/get-receipt-data-ios and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.
My request: [describe what customers should be able to do]iOS getReceiptDataIOS
Get base64-encoded receipt data for legacy validation (iOS 15+, macOS 14+).
Reads Bundle.main.appStoreReceiptURL and base64-encodes the file. Legacy StoreKit 1 flow — prefer JWS / verifyPurchase. See the Apple StoreKit reference.
Signature
swift
func getReceiptDataIOS() async throws -> String?Returns#
Promise<string | null> — Base64-encoded receipt data (legacy StoreKit 1 path).
Example
swift
let data = try await OpenIapModule.shared.getReceiptDataIOS()iOS receipts contain all transactions for the bundle, not just the latest one. For per-transaction validation prefer getTransactionJwsIOS. If the receipt file has not yet been written (e.g. immediately after the very first purchase), Apple recommends calling syncIOS and retrying.