FirebaseRemoteConfig does not use options from FirebaseApp.initializeApp()

274 views Asked by At

On Android, if I initialize Firebase programmatically:

FirebaseOptions options = new FirebaseOptions.Builder()
        .setApplicationId(APP_ID)
        .setApiKey(apiKey)
        .setDatabaseUrl(databaseUrl)
        .build();
FirebaseApp.initializeApp(context.getApplicationContext(), options);

FirebaseRemoteConfig will not use the app ID that was used to initialize Firebase.

I need to initialize Firebase programmatically in my app because I have a switch to switch between the production & staging Firebase instances in my app, and relying on the google-services.json or specifying the values in strings.xml does not let me change those values at runtime.

Is there a way to specify the app ID to use with FirebaseRemoteConfig programmatically?

1

There are 1 answers

1
carloshwa On BEST ANSWER

I asked the Firebase team and they said this is a known issue that will be fixed in a future release.