restorePurchases static method

Future<PurchasesResponse> restorePurchases()

Restores all the previous purchases of current user.

If user has purchases from previous installations of the application, it is possible to restore them by using this method.

Apple obliges developers to add a restore button in their applications.

Android doesn't require a restore function. So, the method will not work on Android devices.

Callbacks PurchasesResponse and GenericError in case of failure.

Implementation

static Future<PurchasesResponse> restorePurchases() async {
  List<Object?>? response = await _channel.invokeMethod('restorePurchases');
  return _getPurchasesFromResponse(response);
}