Restore purchases
Enable players to regain access to previously owned products and subscriptions when they reinstall your app or switch devices.
Read time 1 minuteLast updated 10 hours ago
The Restore purchases feature allows players to access previously owned non-consumable products and active, renewable subscriptions without paying again. App stores maintain a permanent record of these entitlements, and Unity IAP can retrieve them to grant access. Non-renewable subscriptions on Apple platforms can't be restored. If you use non-renewable subscriptions on Apple, you must maintain your own subscription records and synchronize entitlements across devices.
Google Play
- After reinstall, Unity IAP restores owned products on the first call.
StoreController.FetchPurchases() - IAP invokes the listener with an
OnPurchasesFetchedobject that includes all purchases (all states).Orders - If the setting is set to true, IAP invokes the
PurchaseService.ProcessPendingOrdersOnPurchasesFetchedlistener for each unfulfilled purchase.OnPurchasePending - Subsequent calls in the same session don't trigger
FetchPurchases()for orders that are already seen by the developer in the same session.OnPurchasePending
Apple platforms
- You must provide a Restore Purchases button (mandatory by Apple).
- The button calls which requests a transaction resync from Apple to resync transactions and may prompt the user to authenticate.
PurchaseService.RestoreTransactions - After resync, Unity IAP calls and invokes
FetchPurchaseswith all transactions for the user.OnPurchasesFetched
Restore purchases (Apple platforms)
void RestorePurchases(){ UnityIAPServices.StoreController().RestoreTransactions((success, error) => { if (success) { // This does not mean anything was restored, // merely that the restoration process succeeded. } else { // Restoration failed. `error` contains the failure reason. } });}