react-native-iap: getProducts() is empty

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

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 18 (4 by maintainers)

Most upvoted comments

you should get them, after release

same (ios)