question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

empty products array

See original GitHub issue

Version 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:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jonasgroendahlcommented, Jun 16, 2020

that worked!

0reactions
daheeahncommented, Dec 16, 2020

@ixuz

Ensure that you’ve completely filled out the section: “Agreements, Tax and Banking”. Otherwise you’ll only see empty arrays.

Thanks!

Read more comments on GitHub >

github_iconTop 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 >
Array.Empty<T> Method (System) - Microsoft Learn
Returns an empty array.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found