Android Question Use of the Billing library and surrounding areas

toro1950

Active Member
Licensed User
Good day everyone, I'm trying to list my app on the Google Play Console and would like to sell it
through an annual subscription with automatic renewal, including a one-week free trial.
So I should use the Billing library, but I don't quite understand how it works. What's the BILLING_KEY constant,
the license? I think I found it, it's 392 characters long, is that normal?
What is the ADS_SDK_ID constant, and where can I find it? I think more than a few of you have experience with this,
so I'd appreciate some explanations, both for the library and the subscription. I downloaded the example
of the library, and in it I find the subtitle below, which I don't understand what it's for; it seems to remove ads,
but which ones? Is ADS_SDK_ID an array? What data is inside? I'm sorry, but I'm really clueless.
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)
'        If Result.IsSuccess And SkuDetails.Size = 1 Then
'            Result = billing.LaunchBillingFlow(SkuDetails.Get(0))
'            If Result.IsSuccess Then Return
'        End If
        If Result.IsSuccess Then
            If SkuDetails.Size > 0 Then
                Dim offers As List = SkuDetails.Get(0).As(JavaObject).RunMethod("getSubscriptionOfferDetails", Null)
                Dim offer As JavaObject = offers.Get(0)
                Dim OfferToken As String = offer.RunMethod("getOfferToken", Null)
'                Result = billing.LaunchBillingFlow(SkuDetails.Get(0))
                Result = LaunchBillingFlow(billing, SkuDetails.Get(0), OfferToken)
                If Result.IsSuccess Then Return
            Else
                ToastMessageShow("Error SKU not found", True)
                Return
            End If
        End If
    End If
    ToastMessageShow("Error starting billing process", True)
End Sub
 
Top