Android Question Get products available to buy -In-App Purchase

Chris Guanzon

Active Member
Licensed User
Longtime User
Hello, how can I get all the available products in my in-app products?

I'm using GooglePlayBilling 1.11 library.

The only available queries are QueryPurchases and QuerySkuDetails. Which one should I use?

The attached file is the screenshot from google developers.

1653442122973.png
 

asales

Expert
Licensed User
Longtime User
Check this example from Erel.
Works fine to in-app purchases and with a few modifications you can use to subscriptions:
 
Upvote 0

Chris Guanzon

Active Member
Licensed User
Longtime User
Check this example from Erel.
Works fine to in-app purchases and with a few modifications you can use to subscriptions:

I've already tried this. But what I really want is to get all the available products in my in-app products.

In Erel's example, using QueryPurchases can only get all owned products.

Is this the same for getting all available products in my in-app products?
 
Upvote 0

Chris Guanzon

Active Member
Licensed User
Longtime User
Hello, this is the code I am using. I can't get any of the products in my in-app product.


B4X:
Private Sub getAvailableProducts
    wait for (Starter.Billing.ConnectIfNeeded) Billing_Connected (Result As BillingResult)
    If Result.IsSuccess Then
        Dim sf As Object = Starter.billing.QuerySkuDetails("inapp", Array("c.test.product_1", "c.test.product_2", "nc.test.product_1", "nc.test.product_2"))
        Wait For (sf) Billing_SkuQueryCompleted (Result As BillingResult, SkuDetails As List)
        If Result.IsSuccess And SkuDetails.Size <> 0 Then
            Log(SkuDetails.Get(0))
        End If
    End If
End Sub
 
Upvote 0
Top