restorePurchases method

Future<AdaptyProfile> restorePurchases()

To restore purchases, you have to call this method.

Returns:

  • A result containing the AdaptyProfile object. This model contains info about access levels, subscriptions, and non-subscription purchases. Generally, you have to check only access level status to determine whether the user has premium access to the app.

Implementation

Future<AdaptyProfile> restorePurchases() async {
  final result = (await _invokeMethodHandlingErrors<String>(Method.restorePurchases)) as String;
  return AdaptyProfileJSONBuilder.fromJsonValue(json.decode(result));
}