你好,我目前正在使用Firebase的本地模拟器和Flutter。但是,我使用的是真实设备而不是模拟器,因此我不知道如何连接到我的笔记本电脑的本地主机。我目前正在使用以下代码:
// [Firestore | localhost:8080]
FirebaseFirestore.instance.settings = const Settings(
host: "localhost:8080",
sslEnabled: false,
persistenceEnabled: false,
);
// [Authentication | localhost:9099]
await FirebaseAuth.instance.useEmulator("http://localhost:9099");
FirebaseFunctions.instance.useFunctionsEmulator(
origin: "http://localhost:5001"
);
// [Storage | localhost:9199]
await FirebaseStorage.instance.useEmulator(
host: "localhost",
port: 9199,
);
FirebaseFunctions.instanceFor(region: 'europe-west1').useFunctionsEmulator('192.168.50.43', 5001);
cloud_functions@^3.0.3 语法 - maganaphttp://...
。你的 IP 地址已经足够了! - Paul