How to use the react-native-firebase.config function in react-native-firebase

To help you get started, we’ve selected a few react-native-firebase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pillarwallet / pillarwallet / src / services / featureFlags.js View on Github external
export async function getRemoteFeatureFlags() {
  if (isTest) return INITIAL_FEATURE_FLAGS;
  if (isDev) firebase.config().enableDeveloperMode();
  const firebaseConfig = firebase.config();
  firebaseConfig.setDefaults(INITIAL_FEATURE_FLAGS);
  await firebaseConfig.fetch(0).catch(() => null); // 0 – try no caching, though Firebase can still throttle requests
  await firebaseConfig.activateFetched().catch(() => null);
  const featureFlagKeys = Object.keys(INITIAL_FEATURE_FLAGS || {});
  const fetchedFlags = await firebaseConfig.getValues(featureFlagKeys).catch(() => ({}));
  const mappedFeatureFlags = Object.keys(fetchedFlags).reduce((flags, flagKey) => ({
    ...flags,
    [flagKey]: !!fetchedFlags[flagKey].val(),
  }), {});
  return isDev
    ? { ...mappedFeatureFlags, ...DEVELOPMENT_FEATURE_FLAGS }
    : mappedFeatureFlags;
}
github mikelambert / dancedeets-monorepo / mobile / js / remoteConfig.js View on Github external
export async function get(value: String): any {
  const result = await firebase.config().getValue(value);
  if (result) {
    return JSON.parse(result.val());
  }
  return null;
}
github mikelambert / dancedeets-monorepo / mobile / js / remoteConfig.js View on Github external
async function loadConfig() {
  if (__DEV__) {
    firebase.config().enableDeveloperMode();
  }
  await firebase.config().fetch();
  await firebase.config().activateFetched();
}
github mikelambert / dancedeets-monorepo / mobile / js / learn / liveLearnConfig.js View on Github external
async function loadConfig() {
  if (__DEV__) {
    firebase.config().enableDeveloperMode();
  }
  await firebase.config().fetch();
  await firebase.config().activateFetched();
}
github hyperjumptech / universal-update-checker / src / default-local-remote.js View on Github external
.then(() => {
      return firebase.config().activateFetched();
    })
    .then(() => {
github mikelambert / dancedeets-monorepo / mobile / js / remoteConfig.js View on Github external
async function loadConfig() {
  if (__DEV__) {
    firebase.config().enableDeveloperMode();
  }
  await firebase.config().fetch();
  await firebase.config().activateFetched();
}
github mikelambert / dancedeets-monorepo / mobile / js / remoteConfig.js View on Github external
async function loadConfig() {
  if (__DEV__) {
    firebase.config().enableDeveloperMode();
  }
  await firebase.config().fetch();
  await firebase.config().activateFetched();
}