chirag04 / react-native-in-app-utils

A react-native wrapper for handling in-app payments
MIT License
892 stars 187 forks source link

InAppUtils.loadProducts alway return empty array and purchase got invalid_product #201

Closed taeyzzz closed 5 years ago

taeyzzz commented 5 years ago

Hi guys these are my code to do in app purchase ios react native it used to be work but right now it's not working anymore. result after i loadProducts i alway got empty array and then i call purchaseProduct alway got response 'invalid_product'

buyConsumePurchaseIOS(productId, amount){
var products = [
      'myapp.app.5credits',
      'myapp.app.10credits',
      'myapp.app.15credits',
    ];
    InAppUtils.loadProducts(products, (error, loadedProduct) => {
      console.log('error load product', error)
      console.log('available products', loadedProduct)
      if(error) return
      console.log(productId);
      InAppUtils.purchaseProduct('myapp.app.5credits', (error, response) => {
        console.log('res',response)
        console.log('ERROR', error)
        if(error){
          this.setState({
            showLoading: false
          })
          return
        }
        if(response && response.productIdentifier) {
          // Alert.alert('Purchase Successful', 'Your Transaction ID is ' + response.transactionIdentifier);
          // Alert.alert('Purchase Successful', 'Thank you for purchase ' + amount + ' credits');
          this.addCredit(amount)
        }
      });
    });
}

version

"react": "16.2.0",
"react-native": "0.55.4",
"react-native-in-app-utils": "^6.0.1",

xcode Version 10.1 (10B61)

Please help

Thank you

taeyzzz commented 5 years ago

Sorry my bad

i forgot to accept new agreement in develop account

13arturbruno commented 5 years ago

How to accept new agreement ?

taeyzzz commented 5 years ago

@13ArturBruno in apple develop account

zxwGH commented 2 years ago

苹果开发帐户中的@13ArturBruno

@13ArturBruno in apple develop account

Do you need to set up tax?