Android Question Subscriptions

adriano.freitas

Active Member
I need to add the possibility of having subscriptions in my app. I looked at all the posts I found and tried to do everything correctly, including considering information updates, however, nothing happens when trying to trigger the subscription process from an application button.

In the line of code that does this, (wait for...) nothing happens and it doesn't even execute the LOG that comes after... strange. I don't understand.

After setting up the subscription in the console, does it take a while for it to work? if yes how long?

Does the Billing Class have to be instantiated in the STARTER module or can it be in the application's main module?

I know that maybe you don't have time for this, but for some beginners like me it is very difficult to gather fragmented information and in some points without detail. I think it would be very helpful for everyone to have a step by step of this process.

Grateful for any help!

(below the code of my subscribe button)


Subscription Button Code:
Sub BotaoArteAssinar_Click
    '
    ' Evento disparado quando o usuário clica
    ' no botão para assinar o aplicativo
    '
    Log("Clicou Assinar")
    '
    ' Verifica que o serviço da google store está
    ' conectado
    '
    Wait For (Starter.Assinatura.ConnectIfNeeded) Billing_Connected (Resultado As BillingResult)
    Log("Resultado: " & Resultado.IsSuccess)    ' <---- don't works
    '
    ' Se a conexão estiver ok
    '
    If (Resultado.IsSuccess) Then
        '
        ' Pega os detalhes do SKU
        '
        Log("Iniciando Processo")
        Dim ColetaDeSKU As Object = Starter.Assinatura.QuerySkuDetails("subs", Array(ADS_SDK_ID))
        Wait For (ColetaDeSKU) Billing_SkuQueryCompleted (Resultado As BillingResult, DetalhesDoSKU As List)
        Log("Detalhes: " & DetalhesDoSKU)
        '
        ' Verifica se obteve retorno com sucesso
        '
        Log("Sucesso: " & Resultado.IsSuccess)
        If (Resultado.IsSuccess) And (DetalhesDoSKU.Size = 1) Then
            '
            ' Verifica se o processo de assinatura
            ' ocorreu com sucesso, caso em que retorna
            '
            Resultado = LaunchBillingFlow(Starter.Assinatura,DetalhesDoSKU.Get(0),"sspost-testegratis")
            If (Resultado.IsSuccess) Then Return
        End If
    End If
    '
    ' Se chegou até aqui é porque não conseguiu
    ' realizar a assinatura
    '
    Log("Error starting billing process")
End Sub
 
Top