Replies: 1 comment
-
|
for iOS Simulator localhost should work but there are quirks. for Android physical device its trickier.
import { getFunctions, connectFunctionsEmulator } from "firebase/functions";
const functions = getFunctions();
if (__DEV__) {
connectFunctionsEmulator(functions, "127.0.0.1", 5002);
}
connectFunctionsEmulator(functions, "192.168.1.147", 5002);also make sure emulator is binding to 0.0.0.0: firebase emulators:start --host 0.0.0.0
try {
const result = await httpsCallable(functions, "yourFunction")({});
console.log("connected!", result);
} catch (e) {
console.log("error:", e.code, e.message);
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Quick Question: Functions Emulator Connection Issues
TL;DR: Cannot connect to Firebase Functions emulator from iOS Simulator and Android physical device, despite trying multiple approaches. Android Simulator works perfectly.
Problem
localhost:5002)java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failedWhat We've Tried
functions().useEmulator()andconnectFunctionsEmulator()localhost,127.0.0.1,10.0.2.2, network IP192.168.1.147:5002android_bypass_emulator_url_remapgetFunctions()Questions
useEmulator()instance method orconnectFunctionsEmulator()modular API?localhostwork on iOS Simulator? (It works in Safari)RN Firebase version: 23.4.0
Expo version: 54.0.20
React Native version: 0.81.5
Emulator port:
5002Related: #6475
Beta Was this translation helpful? Give feedback.
All reactions