react-native-iap
react-native-iap copied to clipboard
getAvailablePurchases() method not working with auto-renewable subscriptions in iOS StoreKit 2 mode
Please use the Discussion board if you want to get some help. Please use issues to report bugs.
Description
Hello, i found out that getAvailablePurchases() method not working with auto-renewable subscriptions in iOS StoreKit 2 mode and returns empty array. I tried to debug swift native code with this method and found next error. productStore.getProduct() verification not working with auto-renewable subscriptions.
Expected Behavior
getAvailablePurchases() method should return array of current user subscriptions.
Screenshots
Environment:
- react-native-iap: 12.14.0
- react-native: 0.74.1
- Platforms (iOS, Android, emulator, simulator, device): iOS
To Reproduce Steps to reproduce the behavior:
Use getAvailablePurchases() method with active subscription in iOS StoreKit 2 mode
[Optional] Additional Context
I discovered that getAvailablePurchases() on ios works, BUT only after fetching all products from App Store. I don't think that is approach is best in this case. Also Android works without fetching products.
I have the same issue.
I have the same issue. Did anyone got any solution to it?
@mobilesmartdev In my current workaround i parse all existing in-app products and subscriptions with getSubscriptions() and getProducts() methods on the app launch. After this getAvailablePurchases() method works as expected.
@mobilesmartdev In my current workaround i parse all existing in-app products and subscriptions with
getSubscriptions()andgetProducts()methods on the app launch. After thisgetAvailablePurchases()method works as expected.
True !
It's really a hidden obstacle, cost me a while
same
@mobilesmartdev In my current workaround, I parse all existing in-app products and subscriptions with
getSubscriptions()andgetProducts()methods on the app launch. After this, thegetAvailablePurchases()method works as expected.
Yes, it really runs. Thank u
I’m closing all issues reported in versions below 14, as the library now supports the new architecture with NitroModules and has been completely revamped.