跳过主要内容
返回插件
@capgo/capacitor-firebase-remote-config
教程
@capgo/capacitor-firebase-remote-config

Firebase Remote Config

Capacitor与Firebase Remote Config的集成

指南

Firebase Remote Config教程

使用@capgo/capacitor-firebase-remote-config

Capacitor插件

安装

bun add @capgo/capacitor-firebase-remote-config
bunx cap sync

此插件暴露

  • activate - 使最后获取的配置可供获取者使用。
  • fetchAndActivate - 执行 fetch 和 activate 操作。
  • fetchConfig - 从 Remote Config 服务中获取和缓存配置。
  • getBoolean - 根据给定的键获取值作为布尔值。

示例用途

activate

使最后获取的配置可供获取器使用。

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

await FirebaseRemoteConfig.activate();

fetchAndActivate

执行 fetch 和 activate 操作。

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

await FirebaseRemoteConfig.fetchAndActivate();

fetchConfig

从 Remote Config 服务获取并缓存配置。

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

await FirebaseRemoteConfig.fetchConfig();

getBoolean

根据给定的键获取值作为布尔值。

import { FirebaseRemoteConfig } from '@capgo/capacitor-firebase-remote-config';

await FirebaseRemoteConfig.getBoolean({} as GetBooleanOptions);

完整参考

继续使用 @capgo/capacitor-firebase-remote-config

如果您正在使用 使用@capgo/capacitor-firebase-远程配置 规划原生插件工作,连接它 Capgo 插件目录 在Capgo 插件目录中 Capacitor 插件由Capgo 在Capacitor 插件由Capgo中 添加或更新插件 在添加或更新插件中 Ionic 企业插件替代品 在Ionic 企业插件替代品中 Capgo 原生构建 在Capgo 原生构建中