0

I recently updated the InAppPurchase plugin in flutter. The update is breaking the code. I am unable get past purchases using the InAppPurchase instance.Anyone know how to retreive the past purchase?

Final QueryPurchaseDetailsResponse purchaseResponse =await _inAppPurchase.queryPastPurchases();

1 Answer 1

0

try to use:

  final InAppPurchase _inAppPurchase = InAppPurchase.instance;
  await _inAppPurchase.restorePurchases();
4
  • above _inAppPurchase.restorePurchases(); returns void. I used to get purchaseDetails before using _purchases = purchaseResponse.pastPurchases; after that i verified the purchase using my backend server. Now How do i do that.
    – frank
    Oct 31, 2021 at 9:52
  • According to the docs restorePurchases will retrieve the old purchases. Oct 31, 2021 at 9:54
  • so this action will trigger the purchaseStream?.
    – frank
    Oct 31, 2021 at 10:05
  • Restored purchases will be emitted on the InAppPurchase.purchaseStream Oct 31, 2021 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.