/** * Display price with discount applied if promotion is on. Otherwise display original price. */ // [START display_price] private void DisplayPrice() { long initialPrice = mFirebaseRemoteConfig.GetLong(PRICE_CONFIG_KEY); long finalPrice = initialPrice; if (mFirebaseRemoteConfig.GetBoolean(IS_PROMOTION_CONFIG_KEY)) { // [START get_config_values] finalPrice = initialPrice - mFirebaseRemoteConfig.GetLong(DISCOUNT_CONFIG_KEY); // [END get_config_values] } mPriceTextView.SetText(PRICE_PREFIX_CONFIG_KEY + finalPrice, null); }
public bool IsPromoActive() { return(_firebaseRemoteConfig.GetBoolean("is_promo_active")); }
public bool GetBoolean(string key) => _firebaseRemote.GetBoolean(key);