react-native-iap: An unknown or unexpected error has occured - react-native-iap

Getting error after login to apple for in app purchase payment

Err. message - An unknown or unexpected error has occured. Please try again later.

Err.Code - E_UNKNOWN

First I am loading product via product id then calling for payment

async buyplan() { try { await RNIap.prepare(); const products = await RNIap.getProducts([${this.state.productid}]); await RNIap.buyProduct(this.state.productid).then(purchase => { Toast.show(“Payment Successfully Completed”); }).catch(err => { // Toast.show(“Payment Transaction Failed”); console.warn(err); alert(err.message); }) } catch (err) { console.warn(err); } }

simulator screen shot - iphone 6 - 2018-06-12 at 14 59 36

Please help me out from this. Thanks in advance.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 32 (13 by maintainers)

Most upvoted comments

@immohdali Can’t help you more than that. I’ve look into your code remotely more than an hour yesterday and told you how to improve your code in slack. It was not a bug or anything but just your immature coding skill. You need to solve your problem yourself. I can answer to your question and guide your coding like I’ve done yesterday but I won’t edit your code anymore. I’ve done this kind of thing lots of time and I know that it isn’t healthy. Won’t comeback to this issue either. Also, please see the example project and compare with yours too.

@dooboolab after 2 hours i will be at mac. if possible i will share you my mac control via TeamViewer. i hope you will be free

skype id - immohdali