Calling #loadProducts with different productId resets previously loaded products
Opened this issue · 0 comments
We're seeing an error with 'invalid_product', and digging into the issue, it seems that calling loadProducts
multiple times does not add the new products to the cached products, but rather resets it.
Say you load your main products upon app load:
InAppUtils.loadProducts(['product1', 'product2'], ..)
.. and then later on in a different part of the app load another product:
InAppUtils.loadProducts(['another_product'], ..)
Now trying to purchase product1
will result in an invalid_product
error, even though the product is perfectly valid and purchasable.
The reason is that the productsRequest:request didReceiveResponse:response
delegate does not merge in the newly fetched products with the previously fetched products.
I would expect this to have been the case.
My guess is that this is causing a lot of issue with invalid_product that are still both open and closed here in the issue list.