restorePurchasesWith

fun Purchases.restorePurchasesWith(onError: (error: PurchasesError) -> Unit = ON_ERROR_STUB, onSuccess: (customerInfo: CustomerInfo) -> Unit)

Restores purchases made with the current Play Store account for the current user. This method will post all purchases associated with the current Play Store account to RevenueCat and become associated with the current appUserID. If the receipt token is being used by an existing user, the current appUserID will be aliased together with the appUserID of the existing user. Going forward, either appUserID will be able to reference the same user.

You shouldn't use this method if you have your own account system. In that case "restoration" is provided by your app passing the same appUserId used to purchase originally.

Parameters

onSuccess

Will be called after the call has completed.

onError

Will be called after the call has completed with an error.

Sources

Link copied to clipboard