feat(remote_config): add Firebase Remote Config integration#2170
Open
sharjeelyunus wants to merge 3 commits intomainfrom
Open
feat(remote_config): add Firebase Remote Config integration#2170sharjeelyunus wants to merge 3 commits intomainfrom
sharjeelyunus wants to merge 3 commits intomainfrom
Conversation
- Introduced RemoteConfig and RemoteConfigStub classes for handling remote configuration values. - Implemented RemoteConfigInvokable to expose remote config functionalities. - Added RemoteConfigService for fetching and activating remote config values. - Updated pubspec.yaml and README.md for the new module. - Enabled configuration through starter files for optional integration.
- Added enable_remote_config.dart script for configuring Firebase Remote Config. - Updated package.json to include the new script. - Registered the remote_config module in modules_scripts.ts for integration.
…Config - Added optional environment variables for configuring fetch timeout and minimum fetch interval. - Updated README.md to document new environment variable settings and their usage. - Modified RemoteConfigService to apply settings from environment variables during initialization and fetch operations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Firebase Remote Config Module
Summary
Adds an optional ensemble_remote_config module so apps can use Firebase Remote Config for A/B testing, feature flags, and runtime config in YAML. Off by default; enabled from the starter like other optional modules (Analytics, Stripe).
What's in this PR
RemoteConfig/RemoteConfigStubandensemble.remoteConfigin data context (property access,.get,.refresh,.setDefaults,.all(),.info()). No Firebase dependency in core.ensemble_remote_config: Implements Remote Config (fetch on startup, typedgetValue,setDefaults,refresh, debug helpers,getAllValues,getInfo).remote_config_fetch_timeoutandremote_config_minimum_fetch_intervalenvironment variables controlfetchTimeoutandminimumFetchInterval(with safe defaults). Values are applied on init and re-applied before eachfetchAndActivate()/ensemble.remoteConfig.refresh().useRemoteConfigflag, optional dependency and GetIt registration, enable script that also runs Firebase setup.setDefaultsbehavior).Usage
ensemble.remoteConfig.my_keyensemble.remoteConfig.get('my_key', false)ensemble.remoteConfig.getBool('flag', false)ensemble.remoteConfig.getInt('max_items', 10)ensemble.remoteConfig.getDouble('ratio', 0.5)ensemble.remoteConfig.getString('cta_text', 'Try it now')ensemble.remoteConfig.setDefaults({ flag: true, max_items: 10 })ensemble.remoteConfig.all()ensemble.remoteConfig.info()ensemble.remoteConfig.refresh()How to enable
starter/runnpm run hasRemoteConfig(ornpm run enableand pickremote_config).ensemble_remote_configin starterpubspec.yaml, setuseRemoteConfig = trueand uncomment the import and GetIt line inensemble_modules.dart. Ensure Firebase is configured (google-services.json/GoogleService-Info.plist/ web config).Environment variables
remote_config_fetch_timeout: 10 # seconds, default 10
remote_config_minimum_fetch_interval: 3600 # seconds, default 3600 (1h)
remote_config_minimum_fetch_interval: 0to avoid throttling, then callensemble.remoteConfig.refresh().