FirebaseApp.Create not override default instance
See original GitHub issuePlease fill in the following fields:
Unity editor version: 2018.421f Firebase Unity SDK version: 6.12.0 Source you installed the SDK : unitypackage Firebase plugins in use : Auth FireStore Additional SDKs you are using : Facebook AdMob VoxelBusters Platform you are using the Unity editor on : Windows Platform you are targeting : Android Scripting Runtime : IL2CPP
Please describe the issue here:
(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
FirebaseApp.LogLevel = Firebase.LogLevel.Verbose;
var status = await FirebaseApp.CheckAndFixDependenciesAsync();
var main = FirebaseApp.Create(new AppOptions() {
ProjectId = "{another}",
StorageBucket = "{anotherBucket}"
});
With the code above, the main.Options.ProjectId
and DefaultInstance
still being the ID from config.json
. Is it a bug or is it intended?
Please answer the following, if applicable:
Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)?
- Don’t know
What’s the issue repro rate? (eg 100%, 1/5 etc)
- 100%
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
Overwrite DefaultInstance of the firebase app. Re-initialize: ...
Overwrite DefaultInstance of the firebase app. ... public async Task<bool> TryDeleteFirebaseAppAsync(string name) { var apps = FirebaseApp.
Read more >Firebase Remote Config - Google
To override in-app default values, you use the Firebase console or the Remote Config backend APIs to create parameters with the same names...
Read more >React Native Firebase
Welcome to React Native Firebase! To get started, you must first setup a Firebase project and install the "app" module.
Read more >FirebaseAuthOAuth class - firebase_apple_auth library
The instance of FirebaseAuth will be from the default Firebase App Unless withApp is ... User An error will be throw if there's...
Read more >Working with multiple Firebase projects in an Android app
Firebase provides a bunch of features to use together in your app, provided by a project that you create at the Firebase console....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cynthiajoan In my case I try to switch the default firebase app in my app on the fly. I have firebase app for test and for production. And I have a button to switch it. But then the app was not be created for the specified project as intended
This should be consider a bug because when we try to create the app, it should be created with projectID as a unique key, or we might try to specified more data with new AppOptions. And for the current behaviour the name is misleading. It should be
GetOrCreate
instead of plainCreate
Hi @Thaina, I checked the implementation detail, and yes if we see the project name is same with the default name, we will use the default option that set in the json files. I’d like to get more context of the use case that we have the need of creating multiple projects with the same default name but different options, based on that we can discuss if we want to change this behavior.
Thanks!