Incorrect namespace when using database emulator
See original GitHub issueproduction database URL looks like this: https://chat-2df58.firebaseio.com
emulated database URL looks like this: http://10.0.2.2:9000?ns=chat-2df58
When I initialize the database using this method:
FirebaseDatabase.getInstance('<database_url>');
Namespace is parsed from the URL as a substring from the beginning to the first dot.
It works correctly with the production URL, the namespace will be chat-2df58
.
But if you want to connect to a database emulator, the namespace will be 10
which is completly wrong.
And because of this you cannot fetch the data in the right way: http://localhost:9000/.json?ns=chat-2df58
Instead you must use following url: http://localhost:9000/.json?ns=10
Expected behavior:
If the ns
url parameter is present, use it as a namespace.
If not, parse namespace from the begginning of the URL to the first dot.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top GitHub Comments
@anton9088-new The firebase_database and other plugins are in the process of being updated to use the latest versions of the Android SDKs. Sorry for the delay on this, we are working on it.
The dep should be up to date now. Thanks!