diff --git a/_docs/_developer_guide/platform_wide/feature_flags/create.md b/_docs/_developer_guide/platform_wide/feature_flags/create.md index 8158af6923a..a9b08403392 100644 --- a/_docs/_developer_guide/platform_wide/feature_flags/create.md +++ b/_docs/_developer_guide/platform_wide/feature_flags/create.md @@ -283,19 +283,25 @@ If a feature flag is not enabled, or a property you reference does not exist, th {% tab JavaScript %} ```javascript -// Feature flag instance +// Returns the Feature Flag instance const featureFlag = braze.getFeatureFlag("expanded_user_profile"); -// String properties + +// Returns the String property const stringProperty = featureFlag.getStringProperty("color"); -// Boolean properties + +// Returns the boolean property const booleanProperty = featureFlag.getBooleanProperty("expanded"); -// Number properties + +// Returns the number property const numberProperty = featureFlag.getNumberProperty("height"); -// returns the property as a number in milliseconds + +// Returns the Unix UTC millisecond timestamp property as a number const timestampProperty = featureFlag.getTimestampProperty("account_start"); -// returns the property as a string of the image URL + +// Returns the image property as a String of the image URL const imageProperty = featureFlag.getImageProperty("homepage_icon"); -// returns the JSON property as as JSON object + +// Returns the JSON object property as a FeatureFlagJsonPropertyValue const jsonProperty = featureFlag.getJsonProperty("footer_settings"); ``` @@ -303,19 +309,25 @@ const jsonProperty = featureFlag.getJsonProperty("footer_settings"); {% tab Swift %} ```swift -// Feature flag instance +// Returns the Feature Flag instance let featureFlag: FeatureFlag = braze.featureFlags.featureFlag(id: "expanded_user_profile") -// String properties + +// Returns the String property let stringProperty: String? = featureFlag.stringProperty(key: "color") -// Boolean properties + +// Returns the boolean property let booleanProperty: Bool? = featureFlag.boolProperty(key: "expanded") -// Number properties + +// Returns the number property as a double let numberProperty: Double? = featureFlag.numberProperty(key: "height") -// returns the property as a TimeInterval in milliseconds + +// Returns the Unix UTC millisecond timestamp property as an integer let timestampProperty : Int? = featureFlag.timestampProperty(key: "account_start") -// returns the property as a string of the image URL + +// Returns the image property as a String of the image URL let imageProperty : String? = featureFlag.imageProperty(key: "homepage_icon") -// returns the property as a [String: Any] dictionary + +// Returns the JSON object property as a [String: Any] dictionary let jsonObjectProperty : [String: Any]? = featureFlag.jsonObjectProperty(key: "footer_settings") ``` @@ -323,19 +335,25 @@ let jsonObjectProperty : [String: Any]? = featureFlag.jsonObjectProperty(key: "f {% tab Java %} ```java -// Feature flag instance +// Returns the Feature Flag instance FeatureFlag featureFlag = braze.getFeatureFlag("expanded_user_profile"); -// String properties + +// Returns the String property String stringProperty = featureFlag.getStringProperty("color"); -// Boolean properties + +// Returns the boolean property Boolean booleanProperty = featureFlag.getBooleanProperty("expanded"); -// Number properties + +// Returns the number property Number numberProperty = featureFlag.getNumberProperty("height"); -// returns the property as a nullable long in milliseconds + +// Returns the Unix UTC millisecond timestamp property as a long Long timestampProperty = featureFlag.getTimestampProperty("account_start"); -// returns the property as a string of the image URL + +// Returns the image property as a String of the image URL String imageProperty = featureFlag.getImageProperty("homepage_icon"); -// returns the property as a JSON Object + +// Returns the JSON object property as a JSONObject JSONObject jsonObjectProperty = featureFlag.getJSONProperty("footer_settings"); ``` @@ -343,19 +361,25 @@ JSONObject jsonObjectProperty = featureFlag.getJSONProperty("footer_settings"); {% tab Kotlin %} ```kotlin -// feature flag instance +// Returns the Feature Flag instance val featureFlag = braze.getFeatureFlag("expanded_user_profile") -// string properties + +// Returns the String property val stringProperty: String? = featureFlag.getStringProperty("color") -// boolean properties + +// Returns the boolean property val booleanProperty: Boolean? = featureFlag.getBooleanProperty("expanded") -// number properties + +// Returns the number property val numberProperty: Number? = featureFlag.getNumberProperty("height") -// returns the property as a nullable long in milliseconds + +// Returns the Unix UTC millisecond timestamp property as a long val timestampProperty: Long? = featureFlag.getTimestampProperty("account_start") -// returns the property as a string of the image URL -val String imageProperty: String? = featureFlag.getImageProperty("homepage_icon") -// returns the property as a JSON Object + +// Returns the image property as a String of the image URL +val imageProperty: String? = featureFlag.getImageProperty("homepage_icon") + +// Returns the JSON object property as a JSONObject val jsonObjectProperty: JSONObject? = featureFlag.getJSONProperty("footer_settings") ``` @@ -363,61 +387,126 @@ val jsonObjectProperty: JSONObject? = featureFlag.getJSONProperty("footer_settin {% tab React Native %} ```javascript -// String properties +// Returns the String property const stringProperty = await Braze.getFeatureFlagStringProperty("expanded_user_profile", "color"); -// Boolean properties + +// Returns the boolean property const booleanProperty = await Braze.getFeatureFlagBooleanProperty("expanded_user_profile", "expanded"); -// Number properties + +// Returns the number property const numberProperty = await Braze.getFeatureFlagNumberProperty("expanded_user_profile", "height"); + +// Returns the Unix UTC millisecond timestamp property as a number +const timestampProperty = await Braze.getFeatureFlagTimestampProperty("expanded_user_profile", "account_start"); + +// Returns the image property as a String of the image URL +const imageProperty = await Braze.getFeatureFlagImageProperty("expanded_user_profile", "homepage_icon"); + +// Returns the JSON object property as an object +const jsonObjectProperty = await Braze.getFeatureFlagJSONProperty("expanded_user_profile", "footer_settings"); ``` {% endtab %} {% tab Unity %} ```csharp -// Feature flag instance +// Returns the Feature Flag instance var featureFlag = Appboy.AppboyBinding.GetFeatureFlag("expanded_user_profile"); -// String properties -var stringProperty = featureFlag.getStringProperty("color"); -// Boolean properties -var booleanProperty = featureFlag.getBooleanProperty("expanded"); -// Number property as integer -var integerProperty = featureFlag.getIntegerProperty("height"); -// Number property as double -var doubleProperty = featureFlag.getDoubleProperty("height"); + +// Returns the String property +var stringProperty = featureFlag.GetStringProperty("color"); + +// Returns the boolean property +var booleanProperty = featureFlag.GetBooleanProperty("expanded"); + +// Returns the number property as an integer +var integerProperty = featureFlag.GetIntegerProperty("height"); + +// Returns the number property as a double +var doubleProperty = featureFlag.GetDoubleProperty("height"); + +// Returns the Unix UTC millisecond timestamp property as a long +var timestampProperty = featureFlag.GetTimestampProperty("account_start"); + +// Returns the image property as a String of the image URL +var imageProperty = featureFlag.GetImageProperty("homepage_icon"); + +// Returns the JSON object property as a JSONObject +var jsonObjectProperty = featureFlag.GetJSONProperty("footer_settings"); ``` + {% endtab %} {% tab Cordova %} ```javascript -// String properties +// Returns the String property const stringProperty = await BrazePlugin.getFeatureFlagStringProperty("expanded_user_profile", "color"); -// Boolean properties + +// Returns the boolean property const booleanProperty = await BrazePlugin.getFeatureFlagBooleanProperty("expanded_user_profile", "expanded"); -// Number properties + +// Returns the number property const numberProperty = await BrazePlugin.getFeatureFlagNumberProperty("expanded_user_profile", "height"); + +// Returns the Unix UTC millisecond timestamp property as a number +const timestampProperty = await BrazePlugin.getFeatureFlagTimestampProperty("expanded_user_profile", "account_start"); + +// Returns the image property as a String of the image URL +const imageProperty = await BrazePlugin.getFeatureFlagImageProperty("expanded_user_profile", "homepage_icon"); + +// Returns the JSON object property as an object +const jsonObjectProperty = await BrazePlugin.getFeatureFlagJSONProperty("expanded_user_profile", "footer_settings"); ``` + {% endtab %} {% tab Flutter %} + ```dart +// Returns the Feature Flag instance BrazeFeatureFlag featureFlag = await braze.getFeatureFlagByID("expanded_user_profile"); -// String properties + +// Returns the String property var stringProperty = featureFlag.getStringProperty("color"); -// Boolean properties + +// Returns the boolean property var booleanProperty = featureFlag.getBooleanProperty("expanded"); -// Number properties + +// Returns the number property var numberProperty = featureFlag.getNumberProperty("height"); + +// Returns the Unix UTC millisecond timestamp property as an integer +var timestampProperty = featureFlag.getTimestampProperty("account_start"); + +// Returns the image property as a String of the image URL +var imageProperty = featureFlag.getImageProperty("homepage_icon"); + +// Returns the JSON object property as a Map collection +var jsonObjectProperty = featureFlag.getJSONProperty("footer_settings"); ``` + {% endtab %} {% tab Roku %} + ```brightscript -' String properties +' Returns the String property color = featureFlag.getStringProperty("color") -' Boolean properties + +' Returns the boolean property expanded = featureFlag.getBooleanProperty("expanded") -' Number properties + +' Returns the number property height = featureFlag.getNumberProperty("height") + +' Returns the Unix UTC millisecond timestamp property +account_start = featureFlag.getTimestampProperty("account_start") + +' Returns the image property as a String of the image URL +homepage_icon = featureFlag.getImageProperty("homepage_icon") + +' Returns the JSON object property +footer_settings = featureFlag.getJSONProperty("footer_settings") ``` + {% endtab %} {% endtabs %}