After upgrade to IAP 5: Retrieve Products succeeded, but could not retrieve the attached subset

We recently tried upgrading our app to IAP 5 (Unity 6 LTS) and were using IAP 4.x before without any problems (and we have many daily active users). Now suddenly after upgrading to IAP 5 sometimes one of our products cannot be fetched from the Google Play Store (while all surrounding and other products that have the exact same configuration still work perfectly).

The error that appears:
Retrieve Products succeeded, but could not retrieve the attached subset.
the one consumable purchases that cannot be loaded is attached.
When this error starts happening even an app restart does not resolve the issue. Only waiting a few hours seems to magically resolve the issue. We are not sure if this is due to Google Play using new but unstable APIs or a genuine implementation bug in IAP 5

We saw that onProductsDetailResponse has an open TODO ULO-3790, so we can only assume parts of the implementation are still missing?

Anyways we are not confident rolling out a version of IAP to production that seems rather unstable in retrieving our products from Google Play, any guidance would be apreciated

Hello,

Is this issue still occurring?

If the problem persists, could you please describe in detail how your game initializes IAP products (retrieves products from the store)? If possible, please also attach the relevant initialization script or code.

This information will help us better understand the issue and investigate the cause.

Thank you.

P.S. I don’t speak English very well, so I used AI translation for this message.

Hi @MCF24, so far it did not occur again, so I’m not sure if it was some kind of Google Play outage causing the issue. We use the standard initialization workflow for IAP5, there is not much that could be misconfigured?

s_storeController = UnityIAPServices.StoreController();
s_storeController.OnProductsFetchFailed += OnProductsFetchFailed;
s_storeController.ProcessPendingOrdersOnPurchasesFetched(false);
await s_storeController.Connect();
var catalogProvider = _iapConfigurationBuilder.CreateCatalogProvider();
var productDefinitions = catalogProvider.GetProducts();
s_storeController.FetchProducts(productDefinitions);

the catalog provider is implemented like this:

 var catalogProvider = new CatalogProvider();
catalogProvider.AddProduct("myconsumable1", ProductType.Consumable);
catalogProvider.AddProduct("myconsumable2", ProductType.Consumable);
catalogProvider.AddProduct("myconsumable3", ProductType.Consumable);

now when calling fetch products the OnProductsFetchFailed is called:
OnProductsFetchFailed(ProductFetchFailed failure)
and the failure.FailureReason is the message i provided above

for example myconsumable2 cannot be loaded, while 1 and 3 can be retrieved (All 3 items are configured the same)

Thank you for taking the time to provide such a detailed reply.

I do have one question regarding your implementation. Is there a specific reason you’re using CatalogProvider when fetching products?

In my project, I’m defining the products manually using ProductDefinition, and I haven’t experienced any issues when calling FetchProducts.

If the issue continues, it might be worth trying to initialize the products manually with ProductDefinition instead of retrieving them through CatalogProvider.

The usage is very similar to implementing CatalogProvider:

var productsList = new List<ProductDefinition>();
productsList.Add(new ProductDefinition("item", ProductType.Consumable));
storeController.FetchProducts(productsList);

(I’ve never used CatalogProvider myself, so this is the approach I’m currently using. If CatalogProvider is required for your use case, then my suggestion may not be helpful.)

@MCF24 I was not even aware of this way to add products, but as far as I can see using a CatalogProvider should not change anything regarding fetching of products.

But maybe somebody from the Unity IAP Team can answer that more directly.

Could you show us the Google Play Console setup for these products?

If it’s not occuring again, it could be an intermittent Google Play service outage as you said.

As for FetchProducts, CatalogProvider and List<ProductDefinition> are both valid ways to fetch products.