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.

getProducts() is empty

See original GitHub issue

Version of react-native-iap

4.4.2

Version of react-native

0.61.5

Platforms you faced the error (IOS or Android or both?)

Android

Expected behavior

getProducts(['modulo_training_autogeno']) returns an array with 1 product

Actual behavior

Source for the whole application:

const App: () => React$Node = () => {
  const [productsJSON, setProductsJSON] = useState()

  auth().onAuthStateChanged((user) => {      
    console.log(user)
  })

  useEffect(() => {
    const _myF = async () => {
      console.log("Ciao")
      let outcome = await RNIap.initConnection()
      console.log("Outcome: " + outcome)
      
      let products = await RNIap.getProducts(['modulo_training_autogeno'])
      console.log(JSON.stringify(products))
      setProductsJSON(JSON.stringify(products))
    }

    _myF()
  })

  return (
    <>
      <Video source={{uri:''}}
        ref={ref => AudioPlayer = ref}
        playInBackground={true}
        controls={true}
        fullscreen={true}
      />

      <Text>{productsJSON}</Text>
    </>
  );
};

Got 1 active product on Play Console. Pushed signed apk for internal test.

Screenshot 2020-05-08 at 01 11 50

getProducts(['modulo_training_autogeno']) is the empty array on Android

Tested environment (Emulator? Real Device?)

Real device

Steps to reproduce the behavior

Do everything as said in the medium blog post.

Also seen #977

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tosebikancommented, Dec 22, 2020

you should get them, after release

1reaction
tosebikancommented, Nov 12, 2020

same (ios)

Read more comments on GitHub >

github_iconTop Results From Across the Web

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:.
Read more >
getProducts() returning empty array - Extensions
I am getting an empty array when I call window.Twitch.ext.bits.getProducts in my extension. ... getProducts() returning empty array.
Read more >
[EXPO] How to fetch products from RevenueCat? Why does ...
[EXPO] How to fetch products from RevenueCat? Why does Purchase.getProducts(['productId']) return empty array? 4 months ago.
Read more >
Get Products (getProducts method) - Cordial Knowledge Base
If you would like to leave a preceding parameter blank, it must be populated by either empty brackets "[]" for arrays or the...
Read more >
[Solved]-React-Native-iap getProducts() returns empty array
[Solved]-React-Native-iap getProducts() returns empty array. Related Posts. Failed to load webpage - error (NSURLErrorDomain error -999) · No such ...
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