Android Question GooglePlayBilling - In App Purchases - Never got my products

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Ive downloded the example from https://www.b4x.com/android/forum/threads/googleplaybilling-in-app-purchases.109945/
It works OK but when I replace the
Public const ADS_SDK_ID As String = "android.test.purchased"
Public const BILLING_KEY As String = "3434ABCDEF..."
for my Key and product it returns nothing.
Ive uploaded my app to GooglePlay and retest and same thing.

PD: What I have are suscriptions, not products, dont know if it makes any difference in the code.
 
Last edited:

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Thanks Erel, Ive done this and nothing, Ive added a log trying to get more info
B4X:
Sub btnRemoveAds_Click
    'make sure that the store service is connected
    Wait For (billing.ConnectIfNeeded) Billing_Connected (Result As BillingResult)
    If Result.IsSuccess Then
        'get the sku details
        Dim sf As Object = billing.QuerySkuDetails("subs", Array(ADS_SDK_ID))
        Wait For (sf) Billing_SkuQueryCompleted (Result As BillingResult, SkuDetails As List)
      Log(Result.CODE_ERROR&" "&Result.ResponseCode&" "&Result.ResponseCodeString)
      Log("Query completed: " & Result.IsSuccess & " size: " & SkuDetails.Size )
        If Result.IsSuccess And SkuDetails.Size = 1 Then
            Result = billing.LaunchBillingFlow(SkuDetails.Get(0))
            If Result.IsSuccess Then Return
        End If
    End If
    ToastMessageShow("Error starting billing process", True)
End Sub
Log(Result.CODE_ERROR&" "&Result.ResponseCode&" "&Result.ResponseCodeString)
Results in: 6 0 OK
Log("Query completed: " & Result.IsSuccess & " size: " & SkuDetails.Size )
Results in: Query completed: true size: 0

Any other thing to test?
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
It is your example, I just change the key the product and inapp for subs.
Which configuration error can I look for?
If you want I can send you my key
 
Upvote 0

rboeck

Well-Known Member
Licensed User
Longtime User
Until now i believe, that your code in #7 is only used to consume a product of type inapps; for subscriptions you dont need to consume. The billing_purchaseUpdated informs your app about the state of your subscription. Maybe i am wrong?
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Ive add a product to test using inapp and same problem.
In any case you need to launch the billing flow.
Neither inapp nor subs work with my Key and products in the Erel example.
 
Upvote 0

rboeck

Well-Known Member
Licensed User
Longtime User
I have three subscriptions and one inapp in use and all looks okay. My only problem is to find out, if a user pauses his subscription.
 
Upvote 0
Top