The proper way to initialize another database is to initialize another application using the FIROptions constructor, for example:
FIRDatabase().database() // gets you the default database let options = FIROptions(googleAppID: bundleID: , GCMSenderID: , APIKey: , clientID: , trackingID: , androidClientID: , databaseURL: "https://othernamespace.firebaseio.com", storageBucket: , deepLinkURLScheme: ) // fill in all the other fields FIRApp.configureWithName("anotherClient", options: options) let app = FIRApp(named: "anotherClient") FIRDatabase.database(app: app!) // gets you the named other database
Or you can initialize from another named plist, and not from a huge constructor:
let filePath = NSBundle.mainBundle().pathForResource("MyCool-GoogleService-Info", ofType:"plist") let options = FIROptions(contentsOfFile:filePath)
Mike mcdonald
source share