react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

E_IAP_NOT_AVAILABLE

Open brenopenia1 opened this issue 1 year ago • 3 comments

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

Hello, I'm trying to run initConnection() and I get this error: E_IAP_NOT_AVAILABLE

versions "react-native": "0.71.8", "react-native-iap": "^12.10.5",

Environment:

  • react-native-iap:
  • react-native:
  • Platforms (iOS, Android, emulator, simulator, device):

brenopenia1 avatar May 19 '23 11:05 brenopenia1

I tried to run this im my code:

const checkConnectionStatus = async () => {

    try {
        const isConnected = await RNIap.initConnection();
        console.log('App Store connection status:', isConnected);
        // isConnected will be true if the connection is successful
      } catch (error) {
        console.log('Error checking App Store connection:', error);
      }
   
  };
  
  and the error E_IAP_NOT_AVAILABLE appears can someone help me?

brenopenia1 avatar May 19 '23 12:05 brenopenia1

Use "connected" instead of your whole code, I hope it will fix your problem

Here is example:- import { useIAP } from "react-native-iap"

const { connected, products, getProducts, finishTransaction, currentPurchase, currentPurchaseError, } = useIAP()

if (!connected) { setConnectionErrorMsg("Please check your internet connection") }

musawarbilal786 avatar May 22 '23 09:05 musawarbilal786

this solution is not working even i put the code in to the connected condition but the app is crash after buy the subscription from the android app

ali03111 avatar Mar 20 '24 11:03 ali03111