0

Is there a way to switch google-services.json file on run-time?

If yes, a code sample is highly appreciated

Thank you

AsiB
  • 137
  • 1
  • 9
  • 2
    You are free to write code to initialize the Firebase SDK with whatever values you like, whenever you like, without a json file. – Doug Stevenson Jul 16 '20 at 21:48
  • 1
    Adding to what @DougStevenson said, you can use [this](https://pub.dev/documentation/firebase_core/latest/firebase_core/FirebaseApp/configure.html) method. – Christopher Moore Jul 16 '20 at 21:49
  • It might also help if you look at this post https://stackoverflow.com/questions/37634767/how-to-connect-to-more-than-one-firebase-database-from-an-android-app/37643374#37643374 – Sarvesh Bhatnagar Jul 16 '20 at 21:53
  • different approach might be to use [link](https://pub.dev/packages/firebase_core) , but I can not get the FirebaseAuth from FirebaseApp object – AsiB Jul 19 '20 at 05:33
  • @DougStevenson : so if i have the following code `final FirebaseOptions SecondayDB_options = const FirebaseOptions( googleAppID: '1:7931046381656:android:2fb28f95a41bde78da062d', gcmSenderID: '7931046381656', apiKey: 'AIzaSyAvG7mVHoX0C_zim1D3UhUITF4ml7Be4fsI', );` and ` final FirebaseApp app = await FirebaseApp.configure( name: 'FB-1', options: SecondayDB_options, );` what is the next step ? how do I get the FirebaseAuth object related? – AsiB Jul 19 '20 at 13:21
  • If you have another question, please post it separately. – Doug Stevenson Jul 19 '20 at 15:21

0 Answers0