retrieveReceiptData static method

Future<String> retrieveReceiptData()

Retrieve the receipt data from your application's main bundle.

The receipt data will be based64 encoded. The structure of the payload is defined using ASN.1. You can use the receipt data retrieved by this method to validate users' purchases. There are 2 ways to do so. Either validate locally or validate with App Store. For more details on how to validate the receipt data, you can refer to Apple's document about About Receipt Validation. If the receipt is invalid or missing, you can use SKRequestMaker.startRefreshReceiptRequest to request a new receipt.

Implementation

static Future<String> retrieveReceiptData() async {
  return (await channel.invokeMethod<String>(
          '-[InAppPurchasePlugin retrieveReceiptData:result:]')) ??
      '';
}