empty products array
See original GitHub issueVersion of react-native-iap
4.4.9
Version of react-native
0.62.2
Platforms you faced the error (IOS or Android or both?)
iOS
Expected behavior
I expect to get an array of products
Actual behavior
I get an empty array
Tested environment (Emulator? Real Device?)
I tested on simulator, real device and even test flight
Steps to reproduce the behavior
The code:
const itemSkus = Platform.select({
ios: [
'productidtest',
'testing'
],
android: []
});
const Payment: React.FC = () => {
useEffect(() => {
const initialRun = async () => {
const wei = await iap.initConnection();
};
initialRun();
}, []);
const getProducts = async () => {
const products = await iap.getProducts(itemSkus);
console.log('prods', products);
Alert.alert(JSON.stringify(products));
};
return (
<View>
<Button onPress={getProducts}>
<Typography>Get products</Typography>
</Button>
</View>
);
};
I enable in-app purchases in Xcode, added the appropiate bundle id and added two entries for the in-app purchases in app store connect. the app is not released and they both say “Missing metadata” in the in-app purchases list view because no review screenshot. not sure if that matters?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
4 Ways to Empty an Array in JavaScript
The second way to empty an array is to set its length to zero: a.length = 0;. The length property is read/write property...
Read more >How do I empty an array in JavaScript? - Stack Overflow
Ways to clear an existing array A : Method 1. (this was my original answer to the question) A = [];. This code...
Read more >In Javascript how to empty an array - Tutorialspoint
Splice the whole array. arr.splice(0, arr.length). This will remove all elements from the array and will actually clean the original array.
Read more >Best way to initialize empty array in PHP - GeeksforGeeks
While push an element to the array it can use $emptyArray[] = “first”. At this time, $emptyArray contains “first”, with this command and...
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
that worked!
@ixuz
Thanks!