smarongiu / Xamarin.Plugin.Firebase.RemoteConfig

Xamarin Forms bindings for Firebase RemoteConfig
MIT License
7 stars 5 forks source link

Xamarin.Plugin.Firebase.RemoteConfig

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.

Platform support

This plugin is compatible with iOS and Android.

Quickstart

Setup

API Usage

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);

iOS

Android

License

Licensed under MIT, see license file.