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();
frank
  • 13
  • 5

1 Answers1

0

try to use:

  final InAppPurchase _inAppPurchase = InAppPurchase.instance;
  await _inAppPurchase.restorePurchases();
Reham Alraee
  • 139
  • 8
  • 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 '21 at 09:52
  • According to the docs restorePurchases will retrieve the old purchases. – Reham Alraee Oct 31 '21 at 09:54
  • so this action will trigger the purchaseStream?. – frank Oct 31 '21 at 10:05
  • Restored purchases will be emitted on the InAppPurchase.purchaseStream – Reham Alraee Oct 31 '21 at 10:07