firebase / firebase/quickstart-unity
Use realtime database Emulator from Unity
- Dominant language
- C#
- Stars
- 923
- Forks
- 456
- PR merge metrics
- No merged PRs in 30d
Description
### [REQUIRED] Please fill in the following fields:
* Unity editor version: 2020.3.25f1
* Firebase Unity SDK version: 8.7.0
* Source you installed the SDK: .unitypackage (.unitypackage or Unity Package Manager)
* Problematic Firebase Component: Database (Auth, Database, etc.)
* Other Firebase Components in use: Database, Auth, Config (Auth, Database, etc.)
* Additional SDKs you are using: _____ (Facebook, AdMob, etc.)
* Platform you are using the Unity editor on: Windows (Mac, Windows, or Linux)
* Platform you are targeting: Emulator (desktop) (iOS, Android, and/or desktop)
* Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)
### [REQUIRED] Please describe the issue here:
Unity crash if use local instance of Database (Emulator)
In unity crash log:
ERROR: Could not initialize persistence: Unable to find app data directory.
Crash !!!
#### Steps to reproduce:
Use this code to connect to the emulator
#### Relevant Code:
```
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(async task =>
{
var dependencyStatus = task.Result;
if (dependencyStatus == DependencyStatus.Available)
{
FirebaseDatabase db = Firebase.Database.FirebaseDatabase.GetInstance("http://localhost:9000/?ns=myns");
var snapshot = await db.GetReference("test").GetValueAsync();
Debug.Log("The value: " + snapshot.Value);
}
});
```
Contributor guide
Assessment
This issue has not been assessed yet.