How to get user purchases from Play Store in Flutter

Viewed 87

I am trying to use in_app_purchase Flutter package to implement paid version of my app. This should turn off ads.

I don't want to listen for purchases as it seems like an unnecessary overhead for my very simple app.

Google Play Billing has queryPurchasesAsync method. Is it possible to do this from Flutter, either with in_app_purchases package or some other way?

1 Answers

It seems to be possible within in_app_purchase package: InAppPurchaseAndroidPlatformAddition.queryPastPurchases

Usage:

final addition = InAppPurchase.instance.getPlatformAddition<InAppPurchaseAndroidPlatformAddition>();
final purchases = await addition.queryPastPurchases();
Related