Reputation: 177
I have an app with Firebase integrated. We switch back and forth between project "Development" and project "Production" in Firebase.
On Android, switching the project is done by replacing the google-services.json
file. Is there any way I can get the Firebase's project name (i.e. Temu Production and Temu Development) from inside Android? Something like FirebaseApp.getInstance().getProjectName()
?
I'm new to Firebase so I'm open to various approaches on project management and infrastructure.
Upvotes: 9
Views: 5707
Reputation: 2310
The project name is provided by the FirebaseApp
class.
Android:
FirebaseApp.getInstance().getOptions().getProjectId()
should do the trick.
iOS (Swift):
FirebaseApp.app()?.options.projectID
works well.
Upvotes: 22