Is there a way a single iOS app build can report to two Firebase projects at the same time? I want to send events to my own personal Firebase account and my client's Firebase account simultaneously, from the same build.
I've investigated using Google Tag Manager to solve this, but with no success.
It should be possible.
Have a look at this post from the Firebase blog. The same principle applies to all platforms but the iOS specific stuff is at the bottom.
By the looks of it, this is an example of the briefest (iOS) code you'd need:
// Alt: load from plist using |FIROptions(contentsOfFile:)|
let options = FIROptions(googleAppID: googleAppID, bundleID: bundleID, GCMSenderID: GCMSenderID, APIKey: nil, clientID: nil, trackingID: nil, androidClientID: nil, databaseURL: databaseURL, storageBucket: nil, deepLinkURLScheme: nil)
FIRApp.configure(withName: "secondary", options: fileopts)
guard let secondary = FIRApp.init(named: "secondary")
else { assert(false, "Could not retrieve secondary app") }
let secondaryDatabase = FIRDatabase.database(app: secondary);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With