Iniziato all'Avvio
Copia un prompt di installazione con i passaggi di installazione e la guida markdown completa per questo plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-firebase-remote-config`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/firebase-remote-config/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Puoi utilizzare la nostra configurazione assistita da AI per installare il plugin. Aggiungi le Capgo competenze al tuo strumento AI utilizzando il seguente comando:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsPoi utilizza il seguente prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-firebase-remote-config` plugin in my project.Se preferisci l'installazione manuale, installa il plugin eseguendo i seguenti comandi e segui le istruzioni specifiche del tuo sistema operativo riportate di seguito:
bun add @capgo/capacitor-firebase-remote-configbunx cap syncimport { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';API Panoramica
Sezione intitolata “API Panoramica”activate
Sezione intitolata “attivare”Fare disponibile la configurazione più recente ai recuperatori.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.activate();fetchAndActivate
Sezione intitolata “fetchAndActivate”Eseguire operazioni di fetch e attivazione.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.fetchAndActivate();fetchConfig
Sezione intitolata “fetchConfig”Recuperare e memorizzare la configurazione dal servizio Remote Config.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.fetchConfig();getBoolean
Sezione intitolata “getBoolean”Ottieni il valore per la chiave specificata come booleano.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.getBoolean({} as GetBooleanOptions);getNumber
Sottosezione intitolata “getNumber”Ottieni il valore per la chiave specificata come numero.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.getNumber({} as GetNumberOptions);getString
Sottosezione intitolata “getString”Ottieni il valore per la chiave specificata come stringa.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.getString({} as GetStringOptions);Ottieni informazioni sull'ultima operazione di fetch.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.getInfo();setMinimumFetchInterval
Sottosezione intitolata “setMinimumFetchInterval”Imposta l'intervallo di fetch minimo.
Solo disponibile per Web.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.setMinimumFetchInterval({} as SetMinimumFetchIntervalOptions);setSettings
Sottosezione intitolata “setSettings”Imposta le impostazioni di configurazione remota.
Sui dispositivi Android, i valori delle impostazioni vengono memorizzati in SharedPreferences.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.setSettings({} as SetSettingsOptions);addConfigUpdateListener
Sottosezione intitolata “addConfigUpdateListener”Aggiungi un ascoltatore per l'evento di aggiornamento della configurazione.
Solo disponibile per Android e iOS.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.addConfigUpdateListener({} as AddConfigUpdateListenerOptionsCallback);removeConfigUpdateListener
Sottosezione intitolata “removeConfigUpdateListener”Elimina un ascoltatore per l'evento di aggiornamento della configurazione.
Sono disponibili solo per Android e iOS.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.removeConfigUpdateListener({} as RemoveConfigUpdateListenerOptions);Riferimento di tipo
Sottosezione intitolata “Riferimento di tipo”FetchConfigOptions
Sottosezione intitolata “FetchConfigOptions”export interface FetchConfigOptions { /** * Define the maximum age in seconds of an entry in the config cache before it is considered stale. * During development, it's recommended to set a relatively low minimum fetch interval. * * Only available for Android and iOS. * * @since 1.3.0 * @default 43200 * @see https://firebase.google.com/docs/reference/js/firebase.remoteconfig.RemoteConfigSettings#minimumfetchintervalmillis */ minimumFetchIntervalInSeconds?: number;}GetBooleanOptions
Sottosezione intitolata “GetBooleanOptions”export type GetBooleanOptions = GetOptions;GetBooleanResult
Sottosezione intitolata “GetBooleanResult”export interface GetBooleanResult { /** * The value for the given key as a boolean. * * @since 1.3.0 */ value: boolean; /** * Indicates at which source this value came from. * * Only available for Android and iOS. * * @since 1.3.0 */ source?: GetValueSource;}GetNumberOptions
Sottosezione intitolata “GetNumberOptions”export type GetNumberOptions = GetOptions;GetNumberResult
Sezione intitolata “GetNumberResult”export interface GetNumberResult { /** * The value for the given key as a number. * * @since 1.3.0 */ value: number; /** * Indicates at which source this value came from. * * Only available for Android and iOS. * * @since 1.3.0 */ source?: GetValueSource;}GetStringOptions
Sezione intitolata “GetStringOptions”export type GetStringOptions = GetOptions;GetStringResult
Sezione intitolata “GetStringResult”export interface GetStringResult { /** * The value for the given key as a string. * * @since 1.3.0 */ value: string; /** * Indicates at which source this value came from. * * Only available for Android and iOS. * * @since 1.3.0 */ source?: GetValueSource;}GetInfoResult
Sezione intitolata “GetInfoResult”export interface GetInfoResult { /** * The Unix timestamp in milliseconds of the last successful fetch, or -1 if no fetch has occurred or initialization is incomplete. * @since 7.5.0 * @example 1762864760 */ lastFetchTime: number; /** * The status of the last fetch attempt. * @since 7.5.0 * @example 1 */ lastFetchStatus: LastFetchStatus;}SetMinimumFetchIntervalOptions
Sezione intitolata “SetMinimumFetchIntervalOptions”export interface SetMinimumFetchIntervalOptions { /** * Define the maximum age in seconds of an entry in the config cache before it is considered stale. * During development, it's recommended to set a relatively low minimum fetch interval. * * @since 1.3.0 * @default 43200 * @see https://firebase.google.com/docs/reference/js/remote-config.remoteconfigsettings#remoteconfigsettingsminimumfetchintervalmillis */ minimumFetchIntervalInSeconds: number;}SetSettingsOptions
Sezione intitolata “SetSettingsOptions”export interface SetSettingsOptions { /** * Defines the maximum amount of milliseconds to wait for a response when fetching configuration from the Remote Config server. * * @since 6.2.0 * @default 60 * @see https://firebase.google.com/docs/reference/js/remote-config.remoteconfigsettings#remoteconfigsettingsfetchtimeoutmillis */ fetchTimeoutInSeconds?: number; /** * Define the maximum age in seconds of an entry in the config cache before it is considered stale. * During development, it's recommended to set a relatively low minimum fetch interval. * * @since 6.2.0 * @default 43200 * @see https://firebase.google.com/docs/reference/js/remote-config.remoteconfigsettings#remoteconfigsettingsminimumfetchintervalmillis */ minimumFetchIntervalInSeconds?: number;}AddConfigUpdateListenerOptionsCallback
Sottosezione intitolata “AddConfigUpdateListenerOptionsCallback”export type AddConfigUpdateListenerOptionsCallback = ( event: AddConfigUpdateListenerOptionsCallbackEvent | null, error: any,) => void;CallbackId
Sottosezione intitolata “CallbackId”export type CallbackId = string;Fonte di verità
Sottosezione intitolata “Fonte di verità”Questa pagina è generata dal plugin’s src/definitions.ts. Riavvia la sincronizzazione quando le informazioni pubbliche API cambiano in modo upstream.
Continua da qui: Iniziare
Sottosezione intitolata “Continua da qui: Iniziare”Se stai utilizzando Avvio per pianificare il dashboard e le API operazioni, connettilo con API Overview per i dettagli di implementazione in API Overview Introduzione per i dettagli di implementazione in Introduzione API Chiavi per i dettagli di implementazione in API Chiavi Dispositivi per i dettagli di implementazione in Dispositivi, e Pacchetti per i dettagli di implementazione in Pacchetti.