Skip to content

6. Query User's Purchased Products

Saeed Moradi edited this page Feb 23, 2022 · 1 revision

You can query user's purchased products by using getPurchasedProducts function in Payment class:

payment.getPurchasedProducts {
    querySucceed { purchasedProducts ->
        ...
    }
    queryFailed { throwable ->
        ...
    }
}

Note that

getPurchasedProducts runs on a background thread and notifies you about the query result in the main thread, this means that you don't have to handle threading by your self.

Reactive way of this

payment.getPurchasedProducts()
    .subscribe({ purchasedProducts ->
        ...
    }, { throwable ->
        ...
    })