How can I separate my firebase prod and dev storage with buildtypes or flavors in android ?
I already know how to separate the database but this doesn't apply to storage.
The problem is that the code to instantiate the storage doesn't rely on google-services.json but on a fixed url :
FirebaseStorage.getInstance().getReferenceFromUrl("gs://dev-app.appspot.com");
buildTypes { debug { buildConfigField "String", "BASE_URL", '"gs://dev-app.appspot.com"' } release { buildConfigField "String", "BASE_URL", '"gs://prod-app.appspot.com"' }
In your code use
FirebaseStorage.getInstance().getReferenceFromUrl(BuildConfig.BASE_URL);