Skip to content

Getting Started

GitHub
クリップボードにコピーします。
bun add @capgo/capacitor-firebase-remote-config
bunx cap sync

インポート

インポート
import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

API オーバービュー

API オーバービュー

__CAPGO_KEEP_0__ を取得してアクティブ化

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.activate();

__CAPGO_KEEP_0__ を取得

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.fetchAndActivate();

Remote Config サービスから取得およびキャッシュする設定

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.fetchConfig();

指定されたキーに対応する値を真偽値として取得

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.getBoolean({} as GetBooleanOptions);

指定されたキーに対応する値を数値として取得

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.getNumber({} as GetNumberOptions);

指定されたキーに対応する値を文字列として取得

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.getString({} as GetStringOptions);

__CAPGO_KEEP_0__

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.getInfo();

__CAPGO_KEEP_2__ “setMinimumFetchInterval”

__CAPGO_KEEP_2__

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.setMinimumFetchInterval({} as SetMinimumFetchIntervalOptions);

__CAPGO_KEEP_2__ “setSettings”

__CAPGO_KEEP_3__ Androidの場合、設定値はSharedPreferencesに保存されます。

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.setSettings({} as SetSettingsOptions);

__CAPGO_KEEP_2__ “addConfigUpdateListener”

AndroidおよびiOSのみで利用可能です。

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.addConfigUpdateListener({} as AddConfigUpdateListenerOptionsCallback);

config updateイベントのリスナーを削除します。

AndroidおよびiOSのみで利用可能です。

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';
await FirebaseRemoteConfig.removeConfigUpdateListener({} as RemoveConfigUpdateListenerOptions);

型参照

型参照

FetchConfigOptions

config取得オプション
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;
}
export type GetBooleanOptions = GetOptions;
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;
}
export type GetNumberOptions = GetOptions;
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;
}
export type GetStringOptions = GetOptions;
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;
}
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;
}
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;
}
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

AddConfigUpdateListenerOptionsCallbackのセクション
export type AddConfigUpdateListenerOptionsCallback = (
event: AddConfigUpdateListenerOptionsCallbackEvent | null,
error: any,
) => void;
export type CallbackId = string;

このページはプラグインから生成されています。 src/definitions.ts. API のパブリック変更をアップストリームで再実行してください。

__CAPGO_KEEP_0__を使用している場合 Getting Started APIと連携して、ダッシュボードとAPIの操作を計画するには APIの概要 APIの概要の実装詳細については Introduction Introductionの実装詳細については APIのキー APIのキーについての実装詳細 デバイス __CAPGO_KEEP_0__の実装詳細についてのデバイス、 __CAPGO_KEEP_0__の実装詳細についてのバンドル __CAPGO_KEEP_0__の編集