I have been trying to implement the Google Play Billing service, as described in
1. I placed the Starter module from the billing example in my Check Printer Free app.
2. I added a managed In App Product Check Printer Free app in Store Presence
3. I added the Base64-encoded RSA public key in Starter, as well as app ID:
When I run the app, billing is connected in Service_Create: Result.isSuccess.
However, when I try to purchase with the below, SkuDetails.size: 0 and I get "Error starting billing process".
It must be something simple, but I am at a loss. Any help will be deeply appreciated.
GooglePlayBilling - In App Purchases
The previous service which was used by InAppBilling3 library is being deprecated and will soon won't be available. GooglePlayBilling is based on the new in app purchases service: https://developer.android.com/google/play/billing/billing_library_overview Usage instructions: 1. Add to the...
www.b4x.com
1. I placed the Starter module from the billing example in my Check Printer Free app.
2. I added a managed In App Product Check Printer Free app in Store Presence
3. I added the Base64-encoded RSA public key in Starter, as well as app ID:
B4X:
Public const ADS_SDK_ID As String = "com.bujardet.checkprinterfree"
Public const BILLING_KEY As String = "MIIBIjANBgkqhkiG9w0BAQEFAAOCA ... 'it is much longer. Cut to post.
When I run the app, billing is connected in Service_Create: Result.isSuccess.
However, when I try to purchase with the below, SkuDetails.size: 0 and I get "Error starting billing process".
It must be something simple, but I am at a loss. Any help will be deeply appreciated.
B4X:
'make sure that the store service is connected
Wait For (Starter.billing.ConnectIfNeeded) Billing_Connected (Result As BillingResult)
If Result.IsSuccess Then
'get the sku details
Dim sf As Object = Starter.billing.QuerySkuDetails("inapp", Array(Starter.ADS_SDK_ID))
Wait For (sf) Billing_SkuQueryCompleted (Result As BillingResult, SkuDetails As List)
Log("Result.Issuccess: " & Result.IsSuccess)
Log("SkuDetails.size: " & SkuDetails.Size)
If Result.IsSuccess And SkuDetails.Size = 1 Then
'start the billing process. The PurchasesUpdated event will be raised in the starter service
Result = Starter.billing.LaunchBillingFlow(SkuDetails.Get(0))
Log("Result.IsSuccess And SkuDetails.Size = 1")
If Result.IsSuccess Then Return
End If
End If
'ToastMessageShow("Error starting billing process", True)
ToastMessageShow(M("ErrorStartingBillingProcess"), True)