Pagina/area: Sito web di marketing Capgo. Ruolo: Etichetta UI breve o elemento di navigazione. Visualizzato in: componente Hero.astro. Chiave di messaggio `hero_title_line2` (Hero Title Line2).
Copia una riga di impostazione 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.
Installare
Sezione intitolata “Installazione”Potresti 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 la seguente richiesta:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-firebase-remote-config` plugin in my project.Se preferisci la configurazione manuale, installa il plugin eseguendo i seguenti comandi e segui le istruzioni specifiche per la piattaforma 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”Rendere 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”Recupera e memorizza la configurazione dal servizio Remote Config.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.fetchConfig();getBoolean
Sezione intitolata “getBoolean”Recupera il valore per la chiave specificata come booleano.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
const result = await FirebaseRemoteConfig.getBoolean({ key: 'key-123' });console.log(result);getNumber
Sottosezione intitolata “getNumber”Ottieni il valore per la chiave specificata come numero.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
const result = await FirebaseRemoteConfig.getNumber({ key: 'key-123' });console.log(result);getString
Sottosezione intitolata “getString”Ottieni il valore per la chiave specificata come stringa.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
const result = await FirebaseRemoteConfig.getString({ key: 'key-123' });console.log(result);Ottieni informazioni sull'ultima operazione di fetch.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
const result = await FirebaseRemoteConfig.getInfo();console.log(result);setMinimumFetchInterval
Sottosezione intitolata “setMinimumFetchInterval”Imposta l'intervallo di fetch minimo.
Disponibile solo per Web.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.setMinimumFetchInterval({ minimumFetchIntervalInSeconds: 43200 });setSettings
Sezione intitolata “setSettings”Imposta le impostazioni di configurazione remota.
Su Android, i valori delle impostazioni vengono persistiti in SharedPreferences.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.setSettings({ fetchTimeoutInSeconds: 60, minimumFetchIntervalInSeconds: 43200,});addConfigUpdateListener
Sezione intitolata “addConfigUpdateListener”Add a listener for the config update event.
Disponibile solo per Android e iOS.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
const result = await FirebaseRemoteConfig.addConfigUpdateListener((event, error) => { console.log(event);});console.log(result);removeConfigUpdateListener
Sezione intitolata “removeConfigUpdateListener”Remove a listener for the config update event.
Disponibile solo per Android e iOS.
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.removeConfigUpdateListener({ id: 'id-123' });Riferimento di tipo
Sezione intitolata “Riferimento di tipo”FetchConfigOptions
Sezione 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
Sezione intitolata “GetBooleanOptions”export type GetBooleanOptions = GetOptions;GetBooleanResult
Sezione 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
Sezione 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
Sezione intitolata “AddConfigUpdateListenerOptionsCallback”export type AddConfigUpdateListenerOptionsCallback = ( event: AddConfigUpdateListenerOptionsCallbackEvent | null, error: any,) => void;CallbackId
Sezione intitolata “CallbackId”export type CallbackId = string;Fonte di verità
Sezione intitolata “Fonte di verità”Questa pagina è generata dal plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.
Continua da qui: Iniziare
Sezione intitolata “Continua da qui: Iniziare”Se stai utilizzando Getting Started 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 nei dispositivi Bundles per i dettagli di implementazione nei Bundle.