接入Google IAP 使用billing 5.0.0版本时响应 FEATURE_NOT_SUPPORT
void OnRequstProduct(String[] productId) {
List<String> skuList = new ArrayList<>();
skuList.addAll(Arrays.asList(productId));
cacheRequestList=productId;
QueryProductDetailsParams params = QueryProductDetailsParams.newBuilder()
.setProductList(
ImmutableList.of(
QueryProductDetailsParams.Product.newBuilder()
.setProductId("")
.setProductType(BillingClient.ProductType.INAPP)
.build())
).build();
if(billingClient == null) {
ShowMessage("BillingClient is NULL!!!");
return;
}
ShowMessage("RequestProduct01");
BillingResult result = billingClient.isFeatureSupported(BillingClient.FeatureType.PRODUCT_DETAILS);
if(result.getResponseCode() == BillingClient.BillingResponseCode.OK){
billingClient.queryProductDetailsAsync(params,
new ProductDetailsResponseListener() {
@Override
public void onProductDetailsResponse(@NonNull BillingResult billingResult, @NonNull List<ProductDetails> list) {
ShowMessage("RequestProduct02");
int responseCode = billingResult.getResponseCode();
ShowMessage("onSkuDetailsResponse:"+billingResult+" code:"+GetResponseText(responseCode));
ShowMessage("RequestProduct03");
switch (responseCode){
case BillingClient.BillingResponseCode.OK:
ShowMessage("RequestProduct04");
RecieveProducts(list);
break;
default:
ShowMessage("RequestProduct05");
RequestProductsFail("Failed to query inventory: " + billingResult.getDebugMessage());
ShowMessage("Failed to query inventory: "+billingResult.getDebugMessage());
break;
}
ShowMessage("RequestProduct06");
}
});
}else{
ShowMessage("Please update your Google Play Store and try again \nCode: " + GetResponseText(result.getResponseCode()));
}