Best practice to manage 2 different databases for debug/release version with the new platform?

2,219 views
Skip to first unread message

Gabriele Mariotti

unread,
May 23, 2016, 9:27:56 AM5/23/16
to Firebase Google Group
We had been using 2 database projects (technically 2 FIREBASE_REFs ) to manage different data for debug and release versions.

Now it is not clear what is the best way to manage this case. 
It seems that 2 apps with the same package name can't be linked with 2 firebase projects (It makes sense since now there is a google-play-service.json which works with the package name).
Is it possible to define more databases inside the same firebase project?
Is it a good idea to use a workaround to have a root json object with two childs, "dbDev" and "dbRelease" and store all your data accordingly ?
Other ideas?


Michael Bleigh

unread,
May 23, 2016, 11:10:14 AM5/23/16
to Firebase Google Group

We strongly encourage you to make separate projects for staging/dev environments. That way you can be sure they are totally separate and have identical capabilities.


--
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/e4cdf382-b82a-4044-a69f-c2b7699f6e5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrey

unread,
May 24, 2016, 1:52:19 AM5/24/16
to Firebase Google Group
Hello, Michael!

Thank you for making things slightly clear!

I'm interested in this topic too, and I wonder if you or someone from your team could be so kind to cover it in detail at your blog, for example.   
I mean may be you already find some good project structure to solve this issue and could share it with us.

First thing that come to my mind is to divide my current project into three modules. One android-library module where I put all stuff from my current project and
two thin application modules com.myapp and com.myapp.dev for release and development/testing accordingly that will depend on library module.

Is it a good way to go or you can advise something better?

Thanks!

Daniel Steigerwald

unread,
May 24, 2016, 10:27:42 AM5/24/16
to Firebase Google Group

Chris Scoville

unread,
May 24, 2016, 10:29:42 AM5/24/16
to Firebase Google Group
For iOS projects, how do you recommend we use two different GoogleService-Info.plist files? For debug builds that we want to point to the dev database, should we call FIRApp.configureWithOptions to specify the values from a dev version of GoogleService-Info.plist, or is there a way to configure the FIRApp.configure() call to pick up the values from a dev plist file instead of the release version of GoogleService-Info.plist?

Gabriele Mariotti

unread,
May 24, 2016, 10:29:42 AM5/24/16
to Firebase Google Group
Can we have 2 firebase projects with the same package ?

Evans Attafuah

unread,
May 24, 2016, 7:17:35 PM5/24/16
to Firebase Google Group
Also very interested in solving the problem. I currently have 3 projects for Dev, Beta( Google Store Beta Test ) and Production. In my android app am using flavors so the google-play-service.json is picked up by Android Studio intuitively by folder creation; but with iOS I haven't yet figured a way of associating the 3 files since I maintain the same development environment -> Dev, Beta ( Test Flight ) and Production. Before new firebase, I was adding the firebase url's to my Build Settings. 


Regards,
Evans. 

Kato Richardson

unread,
May 24, 2016, 8:01:43 PM5/24/16
to Firebase Google Group
Hi Evans, the Firebase URLs could be stored in remote config and you can switch them out for test devices as you see fit for some fun a/b testing possibilities. I'm not sure that's the resolution to everything discussed here, but does open up some interesting possibilities.

--
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.

For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Andrey

unread,
May 25, 2016, 5:01:56 AM5/25/16
to Firebase Google Group
Hello!

Maybe it'll be helpful for someone. 
For android gradle project, the proper way of solving this issue is that:

1. in the firebase console create new project, name it whatever you want. For example yourapp-dev
2. click "Add android app" button and create new app. Name it com.yourapp.debug, for example. New google-services.json file will be downloaded automatically
3. under your project src directory create new directory with name "debug" and copy new google-services.json file here
4 in your module level build.gradle file add following code to the buildTypes block:

        debug {
            applicationIdSuffix
".debug"
       
}

From now when you build debug version, com.yourapp.debug application will be generated using google-services.json from debug directory
and when you build release version, com.yourapp application will be generated using google-services.json from module root directory.

Have a nice day!

Evans Attafuah

unread,
May 25, 2016, 5:13:06 AM5/25/16
to fireba...@googlegroups.com
Hello Kato,

very good suggestion still doesn't solve the real problem. :P 

Regards,
Evans. 

GmailMe

unread,
May 25, 2016, 5:16:35 AM5/25/16
to fireba...@googlegroups.com
Hell Andrey, Android is pretty straight forward, the problem is iOS. 😁

Regards,
Evans 

Sent from my iPhone 6
--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/ZlxW3_C_PYQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

ginny

unread,
Jun 3, 2016, 5:33:00 PM6/3/16
to Firebase Google Group
I am using 2 targets in my XCode project - one for dev and one for staging. Each has its own Firebase database/project. I have 2 GoogleService-info.plist files in the project - one in a folder called "Dev" and one in a folder called "Staging". I set the appropriate target membership for each file in XCode (in File Inspector).

I build the dev target for my development work. When I'm ready for the client to test, I build the staging target (which points to the client's test FB database) and upload that build to iTunes Connect for internal testing.

--g
Message has been deleted

Aaron Alexander

unread,
Jun 16, 2016, 6:18:39 PM6/16/16
to Firebase Google Group
I just hit this problem today trying to work the contents of the 

GoogleService-Info.plist into my own environment configuration system. The problem is the configureWithOptions api doesn't seem to work in this way.. at least not for me. The only way I could get the sdk working properly and not throwing exceptions is using the default FIRApp.configure() api.

My solution was to NOT use the configureWithOptions api and to add all the various 
GoogleService-Info.plist(s) with a suffix (eg: GoogleService-Info.plist.debug) to my project dir( don't actually add this to the project/copy it to built product ).
Then I added a build phase script to detect my build configuration (I actually use a swift flag to define the env and a corresponding class to populate class vars off it automatically.. if you want to see a sample just ask).
and this build phase detects the build and copies the proper GoogleService-Info.plist to the built .app dir without any suffix.

If there is a way to use a GoogleService-Info.plist without any env specific options and still use configureWithOptions i'd rather that, but it's hard to tell if this is the intended use for that api.

--
Aaron



On Monday, May 23, 2016 at 6:27:56 AM UTC-7, Gabriele Mariotti wrote:

GmailMe

unread,
Jun 16, 2016, 7:21:36 PM6/16/16
to fireba...@googlegroups.com
 I want a sample, please. 


Sent from my iPhone 6
--
You received this message because you are subscribed to a topic in the Google Groups "Firebase Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/firebase-talk/ZlxW3_C_PYQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

drunknbass.com

unread,
Jun 17, 2016, 12:13:52 AM6/17/16
to Firebase Google Group
Reply all
Reply to author
Forward
0 new messages