beginRefundRequestForActiveEntitlement static method

Future<RefundRequestStatus> beginRefundRequestForActiveEntitlement()

iOS 15+ only. Presents a refund request sheet in the current window scene for the latest transaction associated with the active entitlement.

Returns RefundRequestStatus: The status of the refund request. Keep in mind the status could be RefundRequestStatus.userCancelled

If the request was unsuccessful, no active entitlements could be found for the user, or multiple active entitlements were found for the user, a PlatformException will be thrown. If called in an unsupported platform (Android or iOS < 15) a UnsupportedPlatformException will be thrown.

Important: This method should only be used if your user can only have a single active entitlement at a given time. If a user could have more than one entitlement at a time, use beginRefundRequestForEntitlement instead.

Implementation

static Future<RefundRequestStatus>
    beginRefundRequestForActiveEntitlement() async {
  final statusCode = await _channel.invokeMethod(
    'beginRefundRequestForActiveEntitlement',
  );
  if (statusCode == null) throw UnsupportedPlatformException();
  return RefundRequestStatusExtension.from(statusCode);
}