React native Expo不适用于firebase emulator
我正在尝试通过我的Expo应用程序在物理设备和模拟设备上访问firestore emulator(本地托管),这两种设备都不工作。当我调用模拟的firestore数据库(例如设置文档)时,它不会显示在UI上。但是,如果我为真正的firestore运行完全相同的代码,它将正常工作 我的firebase.json配置是:React native Expo不适用于firebase emulator,react-native,google-cloud-firestore,expo,firebase-tools,React Native,Google Cloud Firestore,Expo,Firebase Tools,我正在尝试通过我的Expo应用程序在物理设备和模拟设备上访问firestore emulator(本地托管),这两种设备都不工作。当我调用模拟的firestore数据库(例如设置文档)时,它不会显示在UI上。但是,如果我为真正的firestore运行完全相同的代码,它将正常工作 我的firebase.json配置是: { “firestore”:{ “规则”:“firestore.rules”, “索引”:“firestore.indexes.json” }, “仿真器”:{ “firesto
{
“firestore”:{
“规则”:“firestore.rules”,
“索引”:“firestore.indexes.json”
},
“仿真器”:{
“firestore”:{
“端口”:8080
},
}
}
您需要将firebase.json上的主机指定为
“模拟器”:{
“firestore”:{
“端口”:8080
“主机”:“0.0.0.0”
},
如果您在物理设备上进行测试,那么使用计算机的IP地址进行连接会更好。您可以使用内置变量:Constants.manifest.debuggerHost?.split(“:”).shift()
在这里写了一个简短的解释:
我认为您需要提供比“无法访问”更多的调试信息。这很有效!非常感谢:)