Open nhutthanh340 opened 3 years ago
+1 to this one, I've been trying a bunch of different tricks with no luck trying to get this to work for the past two months... tempted to roll my own client that leverages the REST API instead just to get past this hurdle. :/
@nhutthanh340 Just to confirm, the issue only happen when you run in editor, correct?
Taking a look of the documentation, it requires some special API like database.useEmulator("10.0.2.2", 9000);
in order to connect to an emulator. And unfortunately this API is not available in C++/Unity SDK yet.
Let me change this to a feature request. If you are interested in seeing this feature, please upvote the first post to let us know.
I updated the firebase.database sdk to 7.0 and changed the "firebase_url" in both google-services.json and google-services-desktop.json. I can write data to the emulator database. However, it created another database (http://localhost:9000/?ns=127) instead of my original database(http://localhost:9000/?ns=abc). I don't know why.
I have the same issue, it seems when you set the Instance to your localhost, it doesnt accept the name space, and created a new database with the name 'localhost'
return FirebaseDatabase.GetInstance("http://localhost:9000?ns=project-id");
return FirebaseDatabase.DefaultInstance;
I also have the same issue when I tried to connect my Unity project to emulator database. It connected to wrong namespace. Please fix
This feature will also enable unit testing of database functionality. See: https://stackoverflow.com/questions/69126781/how-do-you-write-integration-tests-for-firestore-on-unity
I have upvoted the original post, and I'm hoping it can be prioritized by the Firebase team. 🙏
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the issue here:
(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
Steps to reproduce:
Hi, I'm currently having a problem with the value change listening event in Unity. I use Firebase emulator locally. I just get the snapshot with null value. Can you help me solve this problem. Thanks.
This code is working when I use firebase database realtime on cloud.