Skip to content

6. Query single purchased or subscribed product

Iman khoshabi edited this page May 27, 2021 · 1 revision

Query a single purchased or subscribed product of the user using below code:

/// To get the purchased product
PurchaseInfo? purchaseInfo = await FlutterPoolakey.queryPurchasedProduct('product id')

/// To get the subscribed product
PurchaseInfo? purchaseInfo = await FlutterPoolakey.querySubscribedProduct('product id')

They return null if don't find any product. Otherwise, it returns a PurchaseInfo.

It throws a [PlatformException] with a stacktrace if any error happenss. You must handle the error with your logic.

Clone this wiki locally