Building Multiple Firebase Projects from a Single Unity Codebase

383 views
Skip to first unread message

Alex Ferrier

unread,
Jul 26, 2018, 11:29:03 PM7/26/18
to Firebase Google Group
For those people who have built multiple firebase apps (i.e. requiring multiple google.plist/json files) from a single codebase, do you have any best practices on doing this? Specifically, I'm assuming that you have a folder somewhere with all of your plist/json files for what would be 3 apps in our case, and any time you "activate" a project you copy the appropriate plist and json to the correct name (which firebase looks for) and set projectsettings.bundleId. 

- How do you handle your project switching when working in the editor - an editor menu option that copies the correct plist file into place and changes bundle id? 
- How do you handle not accidentally polluting the wrong project with analytics from a current project during development - a check of FirebaseApp settings on startup? 
- How do you handle continuous builds - just by copying the plist/json file in a prebuild step? 

It would be great if anyone could give specifics, because the details of handling switching something just by copying a file can often by rather more subtle and surprising than you'd think when dealing with two very large subsystems (unity and firebase), both of which have quite a lot of machinery and expectations about how assets/projects work. 

Stewart Miles

unread,
Jul 27, 2018, 3:59:01 PM7/27/18
to Firebase Google Group
FWIW: If your plist / json files contain different bundle IDs for each SKU of your game and they're all in the same Firebase project, the Firebase editor plugin will automatically select the correct one for the bundle ID set in the editor and regenerate resources required to configure Firebase.  So then you only really need to check two things to see where the data will end up, your bundle ID and platform.

If you have multiple Firebase projects, then perhaps you could write a plugin which copies the config file from say YOUR_PROJECT_NAME_google-services.json/plist to google-services.json/plist when switching the selected game?

Cheers,
Stewart

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/65fa6462-1007-4854-a44a-78a7953c1149%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Ferrier

unread,
Jul 28, 2018, 6:51:34 PM7/28/18
to Firebase Google Group
Sounds good, thank you. I think actually the option of having all SKUs in a single firebase project will work fine, at which point everything will work (almost) automagically. 

Alex
Reply all
Reply to author
Forward
0 new messages