In the old Firebase, I used to be able to get reference to different database dynamically at run time (say, switching between dev and prod db, or even switching to a user-defined database URL) because the database URL is passed in as a string when instantiating a db reference.
In the new Firebase, the database URL (along with other settings) live inside
Well, I found the answer anyway. Instead of the usual setup, you'll have to initialize the app manually like so:
let firOptions = FIROptions(googleAppID: googleAppID, bundleID: bundleID, GCMSenderID: GCMSenderID, APIKey: nil, clientID: nil, trackingID: nil, androidClientID: nil, databaseURL: databaseURL, storageBucket: nil, deepLinkURLScheme: nil) FIRApp.configureWithOptions(firOptions) let firebaseRef = FIRDatabase.database().reference()
You can name them too with
Further documentation on this: https://firebase.google.com/docs/reference/ios/firebaseanalytics/interface_f_i_r_app