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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to Expo In App purchases for android default.connectAsync not defined. #7900
Comments
Hi @zelin! It looks like something is going on with the module transpiler. What's happening here is that it's trying to import the default exported value from
Hope it helps! |
I am facing the same issue, please help thanks. |
@zelin are you doing it with expo kit ? |
@fulljsdev259 Yes, you have to eject expo to bare workflow. Only then it will work unfortunately. |
@zelin is your app working now ? |
+1 |
So I am not getting this error on iOS (simulator) when running my app using Expo Client, however, I do get it on Android (simulator/physical device). |
Update: if I build a release APK using Android Studio and install on a physical device, I am able to connect to the Play Store and get products! |
Has there been any movement on this? I am completely unable to connect to the store. The below is what I ran and what showed up in my terminal after hitting the button on my physical device. //@ts-check
import { StatusBar } from 'expo-status-bar';
import React, { useState, useEffect } from 'react';
import { Button, StyleSheet, Text, View } from 'react-native';
import { connectAsync } from 'expo-in-app-purchases'
export default function App() {
useEffect(() => {
console.log("Test App Started")
}, [])
const [name, setName] = useState("Me")
// const [items, setItems] = useState([])
const connectButtonAction = async (evnt) => {
console.log("Connecting to The Store")
await connectAsync()
}
return (
<View style={styles.container}>
<Text>Author: {name}</Text>
<Text>Test App!</Text>
<StatusBar style="auto" />
<Button
onPress={connectButtonAction}
title="Connect to Store"
color="#841584"
accessibilityLabel="Connect to the store"
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffeec0',
alignItems: 'center',
justifyContent: 'center',
},
}); Results in:
Any and all help would be greatly appreciated. |
+1 |
Is there any workaround for this without ejecting expo to bare workflow ? |
@byCedric I have tried these and none of that worked for me :( |
I'm having the same issue on iOS, in the bare workflow after ejecting from expo. I'm on a physical devise, and logged in as a test connect user.
returns undefined. I currently have this in a test component on the dashboard of my app. If I go to another page, and come back, I get the error
So... it is connecting? Why is the initial connectAsync() coming back undefined? UPDATE- |
@gwalshington Check this thread for more details. But As per @andrewhook 's comment |
@dorapax-lab It's already ejected, which is why |
This is expo sdk's current limitation and for now only solution is bare work :/ . There鈥檚 a feature request for managed workflow and it鈥檚 marked as Planned: https://expo.canny.io/feature-requests/p/in-app-purchases @gwalshington FYI Let's hope this will be prioritised and implemented soon. |
@dorapax-lab no shit. in a month, please tell me again it's only available in bare workflow. |
I tried both plugins expo-in-app-purchases and react-native-iap. On rn-iap it returns |
I am struggling with the same issues with @danieltgfischer, please advise. |
@captivatingLunatic So apparently I was running my app with expo start even after ejecting it, so I rebuild it with yarn android and it worked perfectly BUT it throws an error when I try to test the purchase of an item. The optional oldItem option is causing this problem, I saw people who solved it by changing the BillingClient version to the same as Expo In App Purchase. This is an error because in November 2021 all BillingClient versions should be 4 and Expo is 2. Someone else removed setOldSku in BillingManager in Expo InAppPurchase folder, I tried this solution but in my case it didn't work. Anyway, I'll try react-native-iap again. Any updates, please let me know. Thanks |
@danieltgfischer thanks for the advice, but I could not find anyway to change BillingClient version. Please let me know if there is any path or file for doing it. |
@captivatingLunatic, change BillingClint version here. If you are going to use react-native-iap, I using version 7.0.2 and it works very well! |
For those who experience problems in future with Expo InAppPurchases and react-native-iap as"E_IAP_NOT_AVAILABLE", I applied Daniel's advices and build my app with Expo first. This did not worked directly, so I did many many minor changes after reading instructions of react-native-iap. They also did not worked, until I did the build with Android Studio. Now it is working, so you need to use react-native-iap and build your app with Android Studio to avoid these problems. |
This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed. |
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem. |
馃悰 Bug Report
Unable to connect to InAppPurchases following the documentation.
Environment
Expo CLI 3.17.21 environment info:
AndroidSystem:
OS: macOS 10.15.2
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.13.0 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.12.0 - /usr/local/bin/npm
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5900203
Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
npmPackages:
expo: ^36.0.2 => 36.0.2
react: ~16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4
react-navigation: ^4.3.7 => 4.3.7
npmGlobalPackages:
expo-cli: 3.17.21
Steps to Reproduce
I performed
In my LoadingScreen.js
Actual Behavior
I am getting
undefined is not an object (evaluating '_ExpoInAppPurchases.default.connectAsync')
if I use
however if i simply do
I get
The text was updated successfully, but these errors were encountered: