Skip to content

5. Consume a Purchased Product

AmirHosseinAghajari edited this page Apr 12, 2023 · 2 revisions

You can consume a product just by calling ConsumeProduct function in Poolakey class:

Poolakey.ConsumeProduct("Consume", "THE ACTUAL PURCHASE TOKEN")

Private Sub Consume_ConsumeSucceed
    ...
End Sub

Private Sub Consume_ConsumeFailed (Error As PoolakeyException)
    ...
End Sub

PurchaseToken -> You get this token in PurchaseSucceed event when the user purchases a product. Also, you can simple query purchased products by that particular user, using GetPurchasedProducts in Poolakey class, which also gives you PurchaseToken to consume. You can read more about querying purchased products from here.

Note that

ConsumeProduct runs on a background thread and notifies you about the consumption state in the main thread, this means that you don't have to handle threading by yourself.