SKUs not merged in getProducts and getSubscriptions
See original GitHub issueVersion of react-native-iap
1.3.6
Platforms you faced the error (IOS or Android or both?)
iOS
Expected behavior
Get a valid internal list merged with the results of getProducts
and getSubscriptions
Actual behavior
The internal validProducts
only contains the last result set of getProducts
or getSubscriptions
. This will end up in app store calls resulting in “Error: Invalid product ID.”.
Tested environment (Emulator? Real Device?)
Tested on the iOS emulator and the real device.
Steps to reproduce the behavior
I am running code like this with a “correct set” of SKUs in productSkuList
and subscriptionSkuList
:
const prepare = function* () {
console.log('IAP: Preparing in app purchases');
try {
yield RNIap.prepare();
const products = yield RNIap.getProducts(productSkuList);
const subscriptions = yield RNIap.getSubscriptions(subscriptionSkuList);
yield RNIap.endConnection();
yield put(PurchaseActions.prepareSuccess(products, subscriptions));
} catch (error) {
console.log('IAP: Error', error);
yield RNIap.endConnection();
yield put(PurchaseActions.prepareFailed());
}
};
The products are loaded correctly but I am not able to run any buyProduct
-call with SKUs from productSkuList
since the internal array validProducts
is overwritten by the different result from getSubscriptions
. In my opinion this should be fixed or at least more detailed in the documentation since this will cost a lot of time to debug.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Oh. I got the point. I will fix it. Sorry for that.
@dooboolab For sure, will do that an come back to you here.