namespace Guru { using System; using System.Collections.Generic; using Firebase.RemoteConfig; public partial class GuruSDK { public static void FetchAllRemote(bool immediately = false) => RemoteConfigManager.FetchAll(immediately); /// /// 注册云控配置 /// /// /// /// public static void RegisterRemoteConfig(string key, string defaultValue) { RemoteConfigManager.RegisterConfig(key, defaultValue); } /// /// 获取运控配置 /// /// /// /// public static T GetRemoteConfig(string key) where T : IRemoteConfig { return RemoteConfigManager.GetConfig(key); } public static string GetRemoteString(string key, string defaultValue = "") => RemoteConfigManager.GetString(key, defaultValue); public static int GetRemoteInt(string key, int defaultValue = 0) => RemoteConfigManager.GetInt(key, defaultValue); public static long GetRemoteLong(string key, long defaultValue = 0 ) => RemoteConfigManager.GetLong(key, defaultValue); public static double GetRemoteDouble(string key, double defaultValue = 0) => RemoteConfigManager.GetDouble(key, defaultValue); public static float GetRemoteFloat(string key, float defaultValue = 0) => RemoteConfigManager.GetFloat(key, defaultValue); public static bool GetRemoteBool(string key, bool defaultValue = false) => RemoteConfigManager.GetBool(key, defaultValue); /// /// 注册监听某个 Key 的变化 /// /// /// public static void RegisterOnValueChanged(string key, Action onValueChanged) { RemoteConfigManager.RegisterOnValueChanged(key, onValueChanged); } /// /// 注销监听某个 Key 的变化 /// /// /// public static void UnRegisterOnValueChanged(string key, Action onValueChanged) { RemoteConfigManager.UnRegisterOnValueChanged(key, onValueChanged); } /// /// 获取所有云控配置 /// /// public static Dictionary GetRemoteAllValues() => RemoteConfigManager.GetAllValues(); /// /// /// /// /// public static string GetRemoteStaticValue(string key) => RemoteConfigManager.GetStaticValue(key); } }