Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E_IAP_NOT_AVAILABLE #2441

Open
brenopenia1 opened this issue May 19, 2023 · 3 comments
Open

E_IAP_NOT_AVAILABLE #2441

brenopenia1 opened this issue May 19, 2023 · 3 comments

Comments

@brenopenia1
Copy link

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
Copy link
Author

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?

@musawarbilal786
Copy link

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")
}

@ali03111
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants