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.