Android BillingClient: handling onBillingServiceDisconnected before onBillingSetupFinished

856 views Asked by At

Given the code sample from https://developer.android.com/google/play/billing/integrate

billingClient.startConnection(object : BillingClientStateListener {
    override fun onBillingSetupFinished(billingResult: BillingResult) {
        if (billingResult.responseCode ==  BillingResponseCode.OK) {
            // The BillingClient is ready. You can query purchases here.
        }
    }
    override fun onBillingServiceDisconnected() {
        // Try to restart the connection on the next request to
        // Google Play by calling the startConnection() method.
    }
})

At a couple of customers the onBillingServiceDisconnected is called before onBillingSetupFinished. How should this be handled? The connection can't really be restarted as startConnection was never finished. Should startConnection be called anyway?

0

There are 0 answers