Cross-platform library for using Firebase RemoteConfig in Xamarin Forms applications. The plugin provides a simple facade to official Xamarin bindings for Firebase native libs.
This plugin is compatible with iOS and Android.
Call CrossFirebaseRemoteConfig.Current from PCL or client code to use APIs.
/// <summary>
/// Initializes the service.
/// </summary>
/// <param name="defaultConfigResourceName">If set, load defaults from this resource</param>
/// <param name="developerModeEnabled">If set to <c>true</c> developer mode is enabled.</param>
void Init(string defaultConfigResourceName = null, bool developerModeEnabled = false);
/// <summary>
/// Initializes the service without default config.
/// </summary>
/// <param name="developerModeEnabled">If set to <c>true</c> developer mode is enabled.</param>
void Init(bool developerModeEnabled = false);
/// <summary>
/// Fetchs the remote config.
/// </summary>
/// <param name="cacheExpiration">Cache expiration in seconds.</param>
/// <exception cref="FirebaseRemoteConfigFetchFailedException">when fetch fails.</exception>
Task FetchAsync(long cacheExpiration);
/// <summary>
/// Activates the last fetched config.
/// </summary>
void ActivateFetched();
/// <summary>
/// Gets the value with specified key as string.
/// </summary>
string GetString(string key);
/// <summary>
/// Gets the value with specified key as byte array.
/// </summary>
byte[] GetBytes(string key);
/// <summary>
/// Gets the value with specified key as boolean.
/// </summary>
bool GetBool(string key);
/// <summary>
/// Gets the value with specified key as long.
/// </summary>
long GetLong(string key);
/// <summary>
/// Gets the value with specified key as double.
/// </summary>
double GetDouble(string key);
/// <summary>
/// Gets all keys by prefix.
/// </summary>
ICollection<string> GetKeysByPrefix(string prefix);
Firebase.Core.App.Configure();
CrossFirebaseRemoteConfig.Current.Init("my_config_defaults");
base.OnCreate(bundle)
:
Firebase.FirebaseApp.InitializeApp(this);
CrossFirebaseRemoteConfig.Current.Init("my_config_defaults");
Licensed under MIT, see license file.