Flutter How to get past purchases on Android with in_app_purchase: ^1.0.8

Viewed 153

I was using the in_app_purchase package old version but I have to upgrade it to 1.0.8.

I was checking if the user has purchased the product by the code down below:

QueryPurchaseDetailsResponse response = await _iap.queryPastPurchases();
    setState(() {
      _purchases = response.pastPurchases;
    });
    print("PAST PURCHASES: $_purchases");

With 1.0.8, there is no queryPastPurchases method. We have restorePurchases(), so how can implement it to get old purchases to check if the user has already bought the product?

Thank you...

0 Answers
Related