I'm now using the new Play Billing Library
Basically, I followed the documentation to query available items to purchase
SkuDetailsParams.Builder params = SkuDetailsParams.newBuilder();
params.setSkusList(skuList).setType(itemType);
mBillingClient.querySkuDetailsAsync(params.build(),
new SkuDetailsResponseListener() {
@Override
public void onSkuDetailsResponse(int responseCode,
List<SkuDetails> skuDetailsList) {
listener.onSkuDetailsResponse(responseCode, skuDetailsList);
}
However, the responseCode is 0 and the list is also empty. But I checked onBillingSetupFinished is successful. The skuList that provided to SkuDetailsParams.Builder is not empty, and the values inside the skuList (sku_id) is also same as Product ID that specifies on Google Play Console.
Does anyone know the reason? Thanks!!
I have spent few hours with this issue and the problem was that my debug build/CI builds had applicationIdSuffix
. So only production build with proper applicationId was able to retrieve the products.