This article explains when and how restoration works on Apple vs Google Play. It covers: requiring a user-facing Restore Purchases button that calls IAppleExtensions.RestoreTransactions on Apple; automatic restoration during initialization on Google Play; that consumables are never restored; when ProcessPurchase is invoked during restores; avoiding duplicate grants by tracking entitlements; and using receipt validation to confirm subscription status.
Restoring transactions is only needed when a user reinstalls the app, switches devices, or clears local data and needs to regain access to previously purchased Non-Consumables or active Subscriptions. For the Apple App Store, this requires a user-facing “Restore Purchases” button that calls IAppleExtensions.RestoreTransactions. For the Google Play store, restoration happens automatically during IAP initialization, so no manual action is needed. Please note that consumable products are never restored.
RestoreTransactions(Action<bool, string>) as mentioned below. Earlier versions should use RestoreTransactions(Action<bool>).
Apple App Store (iOS, iPadOS, macOS, tvOS)
- A “Restore Purchases” UI that calls
IAppleExtensions.RestoreTransactions(Action<bool, string>)must be provided and explicitly activated by the user; Unity IAP does not automatically call it. - Users may need to authenticate with their Apple ID during the process.
- Unity IAP will invoke
ProcessPurchaseon yourIStoreListenerfor each previously purchased Non-Consumable and Subscription product it can restore. - Consumables are never restored.
- Because
ProcessPurchaseis called again for restored items, ensure your entitlement grant code tracks what the user already owns to avoid duplicate grants. - For subscriptions, use receipt validation to determine current entitlement state (e.g., whether the subscription is active or expired). Do not rely solely on
ProcessPurchaseas “active” without validation. For the most reliable results, consider server-side validation (Apple's App Store Server API) rather than device receipt checks alone.
Google Play (Android)
- Unity IAP automatically queries owned items on initialization. No “Restore Purchases” button or call to
IGooglePlayStoreExtensions.RestoreTransactions(Action<bool, string>)is needed. - As part of initialization, Unity IAP may call
ProcessPurchasefor already-owned Non-Consumables and active Subscriptions. - This can occur after app reinstall or on a fresh install on a device that shares the same Google account.
- Consumables are never restored.
- Because
ProcessPurchasemay be called again for restored items, ensure your entitlement grant code tracks what the user already owns to avoid duplicate grants. - For subscriptions, use receipt validation to determine current entitlement state (e.g., whether the subscription is active or expired). Do not rely solely on
ProcessPurchaseas “active” without validation. For the most reliable results, consider server-side validation (Google's Purchases API) rather than device receipt checks alone.
FAQ
Q: When should I call RestoreTransactions?
A: For the Apple App Store, it is required for restore; call IAppleExtensions.RestoreTransactions (as mentioned above) and prompt user via your UI. For the Google Play store, this is not applicable as restoration happens automatically during IAP initialization and an explicit call is not needed; A manual call will not reprocess already processed transactions.
Q: When is ProcessPurchase called?
A: For the Apple App Store, it is called after a successful purchase and again for each restored item only after RestoreTransactions is invoked. For the Google Play store, is is called after successful purchase, and may be called during initialization for already-owned Non-Consumables and active Subscriptions; A manual call will not reprocess already processed transactions.