My Query_Buy below is working
After doing a Query_Buy my PurchasesUpdated is called but p.IsAcknowledged is always true so I cannot set my Developer Payload. I tried doing the AcknowledgePurchase anyway just to see what would happen and I get back "Google Play In-app Billing API version is less than 9" error message
Google Play In-app Billing API version is less than 9
How do I set the Developer Payload the only place that seems to do this is AcknowledgePurchase but I never can call it
B4X:
#Region Query_Buy
Public Sub Query_Buy(PurchaseFrom As String, ProductID As String) As ResumableSub
Wait For(Starter.gBillingClient.ConnectIfNeeded) Billing_Client_Connected (Result As BillingResult)
If Result.IsSuccess Then 'get the sku details
Dim sf As Object = Starter.gBillingClient.QuerySkuDetails(PurchaseFrom, Array(ProductID))
Wait For(sf) Billing_Client_SkuQueryCompleted(Result As BillingResult, SkuDetails As List)
If Result.IsSuccess And SkuDetails.Size = 1 Then 'start the billing process. The PurchasesUpdated event will be raised in the starter service
Result = Starter.gBillingClient.LaunchBillingFlow(SkuDetails.Get(0))
If Result.IsSuccess Then
Return True
End If
End If
End If
Return False
End Sub
#end Region
After doing a Query_Buy my PurchasesUpdated is called but p.IsAcknowledged is always true so I cannot set my Developer Payload. I tried doing the AcknowledgePurchase anyway just to see what would happen and I get back "Google Play In-app Billing API version is less than 9" error message
B4X:
Public Sub Billing_Client_PurchasesUpdated(Result As BillingResult, Purchases As List)
'-------------------------------------------------------------------------------------------------------------------------
' This event will be raised when the status of one or more of the purchases has changed.
' It will usually happen as a result of calling LaunchBillingFlow however it can be called in other cases as well.
'-------------------------------------------------------------------------------------------------------------------------
If Result.IsSuccess Then
For Each p As Purchase In Purchases
If p.PurchaseState = p.STATE_PURCHASED Then
'--------------------------------------------------------------------------
' Verify the purchase signature.
'--------------------------------------------------------------------------
#if Debug
Log("BKey:" &gBMK &CRLF &"DKey:" &Debug_gBillingManagerKey)
#end if
If gBillingClient.VerifyPurchase(p, gBMK) Then
'----------------------------------------------------------------------
' Was Purchase is Acknowledged???
'----------------------------------------------------------------------
If p.IsAcknowledged = False Then
'------------------------------------------------------------------
' we either acknowledge the product or consume it.
'------------------------------------------------------------------
Wait For(gBillingClient.AcknowledgePurchase(p.PurchaseToken, gSubscriptions.SubscriptionToString(BillingSubscription, True))) Billing_Client_AcknowledgeCompleted(Result As BillingResult)
If Result.IsSuccess Then
Log("Starter::Billing_Client_PurchasesUpdated - Acknowledged: " & Result.IsSuccess)
end if
end if
end if
end if
next
end if
Google Play In-app Billing API version is less than 9
How do I set the Developer Payload the only place that seems to do this is AcknowledgePurchase but I never can call it