@react-native-firebase/remote-config
Version:
React Native Firebase - React Native Firebase provides native integration with Remote Config, allowing you to change the appearance and/or functionality of your app without requiring an app update.
84 lines • 3.61 kB
TypeScript
import type { FirebaseApp } from '@react-native-firebase/app';
import { LastFetchStatus, ValueSource } from './statics';
import type { ConfigUpdateObserver, CustomSignals, LogLevel, RemoteConfig, RemoteConfigOptions, Unsubscribe, Value } from './types/remote-config';
import './types/internal';
export { LastFetchStatus, ValueSource };
export declare const SDK_VERSION = "26.3.2";
/**
* Returns a RemoteConfig instance for the given app.
* @param app - FirebaseApp. Optional.
*/
export declare function getRemoteConfig(app?: FirebaseApp, options?: RemoteConfigOptions): RemoteConfig;
/**
* Returns a Boolean which resolves to true if the current call
* activated the fetched configs.
*/
export declare function activate(remoteConfig: RemoteConfig): Promise<boolean>;
/**
* Ensures the last activated config are available to the getters.
*/
export declare function ensureInitialized(remoteConfig: RemoteConfig): Promise<void>;
/**
* Performs a fetch and returns a Boolean which resolves to true
* if the current call activated the fetched configs.
*/
export declare function fetchAndActivate(remoteConfig: RemoteConfig): Promise<boolean>;
/**
* Fetches and caches configuration from the Remote Config service.
*/
export declare function fetchConfig(remoteConfig: RemoteConfig): Promise<void>;
/**
* Gets all config.
*/
export declare function getAll(remoteConfig: RemoteConfig): Record<string, Value>;
/**
* Gets the value for the given key as a boolean.
*/
export declare function getBoolean(remoteConfig: RemoteConfig, key: string): boolean;
/**
* Gets the value for the given key as a number.
*/
export declare function getNumber(remoteConfig: RemoteConfig, key: string): number;
/**
* Gets the value for the given key as a string.
*/
export declare function getString(remoteConfig: RemoteConfig, key: string): string;
/**
* Gets the value for the given key.
*/
export declare function getValue(remoteConfig: RemoteConfig, key: string): Value;
/**
* Defines the log level to use.
*/
export declare function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void;
/**
* Checks two different things.
* 1. Check if IndexedDB exists in the browser environment.
* 2. Check if the current browser context allows IndexedDB open() calls.
*/
export declare function isSupported(): Promise<boolean>;
/**
* Deletes all activated, fetched and defaults configs and
* resets all Firebase Remote Config settings.
*
* @remarks **Android only.** iOS does not clear activated, fetched, or default configs.
*/
export declare function reset(remoteConfig: RemoteConfig): Promise<void>;
/**
* Sets defaults based on a native resource file.
*
* @remarks Loads defaults from a platform resource — iOS `.plist` or Android XML — identified
* by `resourceName`. No firebase-js-sdk modular equivalent.
*/
export declare function setDefaultsFromResource(remoteConfig: RemoteConfig, resourceName: string): Promise<null>;
/**
* Registers a listener to changes in the configuration.
*
*/
export declare function onConfigUpdate(remoteConfig: RemoteConfig, observer: ConfigUpdateObserver): Unsubscribe;
/**
* Sets the custom signals for the app instance.
*/
export declare function setCustomSignals(remoteConfig: RemoteConfig, customSignals: CustomSignals): Promise<void>;
export type { ConfigUpdate, ConfigUpdateObserver, CustomSignals, FetchResponse, FetchStatus, FirebaseExperimentDescription, FirebaseRemoteConfigObject, LogLevel, RemoteConfig, RemoteConfigOptions, RemoteConfigSettings, Unsubscribe, Value, } from './types/remote-config';
//# sourceMappingURL=index.d.ts.map