Copy this into your coding assistant and add your request.
Read https://openiap.dev/docs/apis/restore-purchases 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]
Restore completed transactions. Use this to implement a "Restore Purchases" button for users who reinstall the app.
iOS: Triggers AppStore.sync() to refresh StoreKit's transaction state; restored purchases are then read via getAvailablePurchases (or directly via Transaction.currentEntitlements). Asks the user to authenticate. Apple docs. Android: Reads owned purchases from the store (Play: queryPurchasesAsync; Amazon: PurchasingService.getPurchaseUpdates) with no system-level UI prompt. React Native, Expo, Flutter, MAUI, Godot, and KMP call the provider's restore. Play and Amazon restores deliver nothing by themselves, while Horizon's restore delivers each owned purchase to the purchase listeners (React Native, Expo, Flutter, MAUI, and KMP). Godot emits no purchase_updated signal; read owned purchases with get_available_purchases_result. Google docs.
Promise<void> — Resolves once the platform finishes the restore. The restored purchases are emitted via purchaseUpdatedListener / surface as getAvailablePurchases results, depending on platform. In MAUI/C#, RestorePurchasesAsync returns Task<string>; the string carries no data, and a failure throws OpenIapException. Godot returns a GodotIapWrapper.RestoreResult extending Types.VoidResult; check success because a failed store query must not be treated as a successful restore. A failed Godot restore exposes code and error in the result and emits one purchase_error with the same code and message. Cancelling the App Store sign-in sheet preserves user-cancelled in both.