Search in sources :

Example 1 with SkuDetailsParams

use of com.android.billingclient.api.SkuDetailsParams in project PhoneProfilesPlus by henrichg.

the class BillingManager method querySkuDetailsAsync.

public void querySkuDetailsAsync(@BillingClient.SkuType final String itemType, final List<String> skuList, final SkuDetailsResponseListener listener) {
    // Specify a runnable to start when connection to Billing client is established
    Runnable executeOnConnectedService = new Runnable() {

        @Override
        public void run() {
            SkuDetailsParams skuDetailsParams = SkuDetailsParams.newBuilder().setSkusList(skuList).setType(itemType).build();
            mBillingClient.querySkuDetailsAsync(skuDetailsParams, new SkuDetailsResponseListener() {

                @Override
                public void onSkuDetailsResponse(int responseCode, List<SkuDetails> skuDetailsList) {
                    listener.onSkuDetailsResponse(responseCode, skuDetailsList);
                }
            });
        }
    };
    // If Billing client was disconnected, we retry 1 time and if success, execute the query
    startServiceConnectionIfNeeded(executeOnConnectedService);
}
Also used : SkuDetails(com.android.billingclient.api.SkuDetails) SkuDetailsResponseListener(com.android.billingclient.api.SkuDetailsResponseListener) SkuDetailsParams(com.android.billingclient.api.SkuDetailsParams)

Example 2 with SkuDetailsParams

use of com.android.billingclient.api.SkuDetailsParams in project PhoneProfiles by henrichg.

the class BillingManager method querySkuDetailsAsync.

public void querySkuDetailsAsync(@BillingClient.SkuType final String itemType, final List<String> skuList, final SkuDetailsResponseListener listener) {
    // Specify a runnable to start when connection to Billing client is established
    Runnable executeOnConnectedService = new Runnable() {

        @Override
        public void run() {
            SkuDetailsParams skuDetailsParams = SkuDetailsParams.newBuilder().setSkusList(skuList).setType(itemType).build();
            mBillingClient.querySkuDetailsAsync(skuDetailsParams, new SkuDetailsResponseListener() {

                @Override
                public void onSkuDetailsResponse(int responseCode, List<SkuDetails> skuDetailsList) {
                    listener.onSkuDetailsResponse(responseCode, skuDetailsList);
                }
            });
        }
    };
    // If Billing client was disconnected, we retry 1 time and if success, execute the query
    startServiceConnectionIfNeeded(executeOnConnectedService);
}
Also used : SkuDetails(com.android.billingclient.api.SkuDetails) SkuDetailsResponseListener(com.android.billingclient.api.SkuDetailsResponseListener) SkuDetailsParams(com.android.billingclient.api.SkuDetailsParams)

Aggregations

SkuDetails (com.android.billingclient.api.SkuDetails)2 SkuDetailsParams (com.android.billingclient.api.SkuDetailsParams)2 SkuDetailsResponseListener (com.android.billingclient.api.SkuDetailsResponseListener)2