问题
If I modify the initializeApp config object parameters via scripting how could I reinitialize the app to use the new values?
The only way it works now is to reload/refresh the page.
Any ideas?
回答1:
You can delete and then reinitialize the the app with
firebase.app().delete().then(function() {
firebase.initializeApp(myNewConfig);
});
Alternatively, you can keep the old app around and initialize a new app with a different name:
firebase.initializeApp(myConfig1);
firebase.initializeApp(myConfig2, 'myOtherApp');
var db1 = firebase.database();
var db2 = firebase.app('myOtherApp').database();
来源:https://stackoverflow.com/questions/37582860/firebase-v3-how-to-reinitialize-default-app