getProducts always returns an empty array on iOS
See original GitHub issueVersion of react-native-iap
0.3.0-beta5
Expected behavior
Should return an array of purchasable products just like in Android.
Actual behavior
Returns an empty array.
Steps to reproduce the behavior
var purchase_ids = {
ios: [
'pro'
],
android: [
'pro'
]
};
return RNIap.prepare()
.then(() => RNIap.getProducts(Platform.select(purchase_ids)))
.then(items => {
if (__DEV__) console.log('RNIap Products:', items);
});
Yes I do have the in app purchases set up in iTunes Connect:
And again, this works perfect on Android.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
react-native-iap getProducts return empty array - Stack Overflow
For those facing this issue with iOS, make sure you finalise the agreements and tax, then make sure to copy and paste this...
Read more >[Solved]-React-Native-iap getProducts() returns empty array
When products aren't fetched, it's most likely some configuration issue. On iOS the most likely culprits are: The products are not in the...
Read more >[EXPO] How to fetch products from RevenueCat? Why does ...
getProducts (['productId']) return empty array? ... Fetching all products by passing an array of their product_id const products = await ...
Read more >Cannot get array of products / subscriptions #651 - Issuehunt
getProducts and RNIap.getSubscriptions always return empty arrays. Tested environment (Emulator? Real Device?) iOS simulator, Android emulator and Android real ...
Read more >Function returns an empty array bu… | Apple Developer Forums
If I try to print the NSMenu "sub" then it's always empty and also if I change the output from loadRSS to a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dooboolab Between changing the status to “Waiting for Review” and also making sure that I had contracts under “Paid Applications” submitted, I’ve got it working. Thank you so much for your assistance and your react native module!
@dooboolab @kodie I was able to get it working.
There is wrong information floating all over these issues such as:
import * as RNIap from 'react-native-iap';
=> it doesn’t matter.import RNIap from 'react-native-iap';
works tooproduct
, notcom.company.product
=> false.com.company.product
works tooI believe what got it working for me was submitting my Paid Applications contract. This also enabled “Auto-renewable Subscriptions” for me.