Платежный клиент всегда доступен

Я выполняю код, описанный в биллинговой библиотеке Google, но мое устройство всегда подключается к биллинговому клиенту, даже если я нахожусь в режиме полета.

//Initiate billing client
        bc = BillingClient.newBuilder(getApplicationContext()).setListener(this).
enablePendingPurchases().build();
        bc.startConnection(new BillingClientStateListener() {
            @Override
            public void onBillingSetupFinished(BillingResult billingResult) {
                if (billingResult.getResponseCode() ==  BillingClient.BillingResponseCode.OK) {
                    // The BillingClient is ready. You can query purchases here.
                    Toast.makeText(getApplicationContext(), "Connected", Toast.LENGTH_SHORT).show();
                }
            }
            @Override
            public void onBillingServiceDisconnected() {
                // Try to restart the connection on the next request to
                // Google Play by calling the startConnection() method.
                Toast.makeText(getApplicationContext(), "Failure", Toast.LENGTH_SHORT).show();
            }
        });

person Dani    schedule 04.05.2020    source источник


Ответы (1)


Сервисы Google Play кэшируют покупки, поэтому они доступны в автономном режиме.

person Ivan Shafran    schedule 04.05.2020