Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leftover deploy - August 15, 2024 #7909

Merged
merged 72 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
e184294
add expanded FF props for wrappers
vanessaland Jul 17, 2024
cfe47c4
update comments
vanessaland Jul 17, 2024
0d0e5af
edit
vanessaland Jul 17, 2024
844d945
edit comments
vanessaland Jul 17, 2024
954057d
Update Unity getImageProperty
vanessaland Jul 17, 2024
cbface1
Remove deprecated api
jacksonemiller Jul 25, 2024
4e5fbdf
Bryan's android changes
jacksonemiller Jul 25, 2024
e56a911
objc
jacksonemiller Jul 26, 2024
1b3c1eb
pascal case for expanded ff props
vanessaland Jul 31, 2024
e38b054
flip tab order of swift and objc
jacksonemiller Aug 7, 2024
9dca5dc
nit
jacksonemiller Aug 7, 2024
b6d71b0
[BD-2880] Content Cards now base reeligibilty on send time
internetisaiah Aug 9, 2024
439b75b
Create adding_braze_js_interface
bovenkam Aug 12, 2024
6523c6d
Update adding_braze_js_interface
bovenkam Aug 12, 2024
39f7940
quick syntax fixes
internetisaiah Aug 12, 2024
df390a2
Merge branch 'develop' into isaiah-martijn-patch-2
internetisaiah Aug 12, 2024
3dd0628
Add preferenc center browser alert
lydia-xie Aug 13, 2024
2d674f2
Adding tabs for readability
internetisaiah Aug 13, 2024
1e813ab
BD-3367 Update screenshot
rachel-feinberg Aug 13, 2024
c386065
Merge pull request #7891 from braze-inc/bd-3367
lydia-xie Aug 13, 2024
41b6262
BD-3372 Add 'Rate' column for WhatsApp metrics
rachel-feinberg Aug 13, 2024
f8a1e2c
Nick's feedback
rachel-feinberg Aug 13, 2024
7f51a61
Add tip to Getting Started overview
bre-fitzgerald Aug 13, 2024
ef71406
Refine steps for adding users
bre-fitzgerald Aug 14, 2024
a49808b
Update _docs/_developer_guide/platform_integration_guides/swift/advan…
bovenkam Aug 14, 2024
0fe1c39
Update _docs/_developer_guide/platform_integration_guides/swift/advan…
bovenkam Aug 14, 2024
7f11948
Update _docs/_developer_guide/platform_integration_guides/swift/advan…
bovenkam Aug 14, 2024
4aad8eb
Update adding_braze_js_interface.md
bovenkam Aug 14, 2024
3f3549f
Apply suggestions from code review
rachel-feinberg Aug 14, 2024
aea4332
Merge pull request #7892 from braze-inc/bd-3372
rachel-feinberg Aug 14, 2024
b363603
use camelcase for existing ff props too
vanessaland Aug 14, 2024
a19af0d
BD-3375: Fix typo
lydia-xie Aug 14, 2024
665c0af
BD-3373 Add A/B section to rate limiting
rachel-feinberg Aug 14, 2024
a76523e
BD-3374 Add A/B section to multivariate campaign
rachel-feinberg Aug 14, 2024
778f4b6
Merge pull request #7896 from braze-inc/bd-3373
rachel-feinberg Aug 14, 2024
d3d649e
Merge pull request #7895 from braze-inc/BD-3375
rachel-feinberg Aug 14, 2024
cdba238
Merge pull request #7897 from braze-inc/bd-3374
rachel-feinberg Aug 14, 2024
8a11530
edit and add into docs
lydia-xie Aug 14, 2024
6dd7cee
Merge pull request #7886 from braze-inc/BD-3371
internetisaiah Aug 14, 2024
49f18d4
BD-3376
lydia-xie Aug 14, 2024
e7945a7
Merge pull request #7899 from braze-inc/BD-3376
rachel-feinberg Aug 14, 2024
9ef3055
site.baseurl
lydia-xie Aug 14, 2024
b5e9211
Merge pull request #7900 from braze-inc/lx-check
internetisaiah Aug 14, 2024
b80fd52
Update _docs/_user_guide/administrative/app_settings/manage_your_braz…
josh-mccrowell-braze Aug 14, 2024
3ead805
Update _docs/_user_guide/administrative/app_settings/manage_your_braz…
josh-mccrowell-braze Aug 14, 2024
6531046
Add Liquid note for Previewing user paths
lydia-xie Aug 14, 2024
231458b
Update _docs/_user_guide/message_building_by_channel/content_cards/cr…
internetisaiah Aug 14, 2024
71bafd7
Merge pull request #7863 from braze-inc/BD-2880
internetisaiah Aug 14, 2024
dc0e292
Merge pull request #7758 from braze-inc/sdk-untracked-appflyer-integr…
internetisaiah Aug 14, 2024
3374d01
Merge pull request #7697 from braze-inc/SDK-5070
internetisaiah Aug 14, 2024
4f73119
Tech writer edits
internetisaiah Aug 15, 2024
5b49b9c
Quick tweak
internetisaiah Aug 15, 2024
27b5ee7
Merge pull request #7872 from bovenkam/adding-swift-webview-page
internetisaiah Aug 15, 2024
257c143
Partner Docs: Zendesk Chat
rachel-feinberg Aug 15, 2024
468a57a
Images
rachel-feinberg Aug 15, 2024
35f6618
Update _docs/_user_guide/engagement_tools/canvas/create_a_canvas/prev…
lydia-xie Aug 15, 2024
a01f795
fixing images
internetisaiah Aug 15, 2024
871ce96
fixing images
internetisaiah Aug 15, 2024
8a4fb0a
Merge pull request #7901 from braze-inc/BD-3360
lydia-xie Aug 15, 2024
5ea9aa4
Resize images and small edits
rachel-feinberg Aug 15, 2024
3526b7e
Clarify email address uniqueness specific to clusters
bre-fitzgerald Aug 15, 2024
d7ed625
BD-3368 Add catalog views details
rachel-feinberg Aug 15, 2024
ea263d5
Style edits
lydia-xie Aug 15, 2024
61184eb
Apply suggestions from code review
rachel-feinberg Aug 15, 2024
36e74d4
Fix step
rachel-feinberg Aug 15, 2024
7e9dda8
Tweaked the language for aliases
josh-mccrowell-braze Aug 15, 2024
9fff6e3
Merge pull request #7893 from braze-inc/BD-3357
josh-mccrowell-braze Aug 15, 2024
b1a7d27
Merge pull request #7903 from braze-inc/zendeskchat
rachel-feinberg Aug 15, 2024
16e2c4a
BD-3381: Data export GA
lydia-xie Aug 15, 2024
4cf5b0a
Merge pull request #7905 from braze-inc/bd-3368
lydia-xie Aug 15, 2024
772d6be
Merge pull request #7907 from braze-inc/BD-3381
internetisaiah Aug 15, 2024
f7cd2d1
Merge pull request #7906 from braze-inc/lydia-xie-patch-3
bre-fitzgerald Aug 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ As soon as you upload your credentials to Braze, you can start sending push noti

- [Verify your sender ID](#step-2-verify-your-sender-id)
- [Verify your permissions](#step-5-verify-permissions-optional)
- Review push notification errors in your [message activity log](https://www.braze.com/docs/user_guide/administrative/app_settings/message_activity_log_tab/)
- Review push notification errors in your [message activity log]({{site.baseurl}}/user_guide/administrative/app_settings/message_activity_log_tab/)

If you're still having trouble, see [Reverting your credentials](#reverting-your-credentials).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ All string values such as first name, last name, country, and home city are limi

### Custom user attributes

In addition to our predefined user attribute methods, Braze also provides [custom attributes](https://www.braze.com/docs/user_guide/data_and_analytics/custom_data/custom_attributes/#custom-attribute-data-types) to track data from your applications.
In addition to our predefined user attribute methods, Braze also provides [custom attributes]({{site.baseurl}}/user_guide/data_and_analytics/custom_data/custom_attributes/#custom-attribute-data-types) to track data from your applications.

```javascript
Braze.setCustomUserAttribute("attribute_key", "attribute_value", function(){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
nav_title: Adding the JavaScript Interface
article_title: Adding the Braze JavaScript Interface to WebViews for Swift
platform: Swift
page_order: 5
description: "This reference article shows how to add the Braze JavaScript Interface to WebViews."

---

# Adding the Braze JavaScript interface to WebViews

> Learn how to add the Braze JavaScript interface to your iOS app, so you can leverage Braze in custom WebViews. After you add the interface, you'll be able to use the API for [HTML in-app messages]({{site.baseurl}}/user_guide/message_building_by_channel/in-app_messages/customize/#custom-html-messages) in your custom WebViews.

## About the interface

The Braze [`ScriptMessageHandler`](https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/webviewbridge/scriptmessagehandler) is responsible for:

1. Injecting the Braze Javascript bridge into your WebView, as outlined in [HTML in-app messages]({{site.baseurl}}/user_guide/message_building_by_channel/in-app_messages/customize/#custom-html-messages).
2. Passing the bridge methods received from your WebView to the [Braze Swift SDK](https://github.com/braze-inc/braze-swift-sdk).

## Adding the interface to a WebView

First, add the [`ScriptMessageHandler`](https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/webviewbridge/scriptmessagehandler) from `WebViewBridge` to your app.

```swift
let scriptMessageHandler = Braze.WebViewBridge.ScriptMessageHandler(braze: braze)
```

Add the initialized `scriptMessageHandler` to a WkWebView's `userContentController`.

```swift
configuration.userContentController.add(
scriptMessageHandler,
name: Braze.WebViewBridge.ScriptMessageHandler.name
)
```

Then create the WebView using your configuration.

```swift
let webView = WKWebView(frame: .zero, configuration: configuration)
```

When you're finished, your code should be similar to the following:

```swift
// Create the script message handler using your initialized Braze instance.
let scriptMessageHandler = Braze.WebViewBridge.ScriptMessageHandler(braze: braze)

// Create a web view configuration and setup the script message handler.
let configuration = WKWebViewConfiguration()
configuration.userContentController.addUserScript(
Braze.WebViewBridge.ScriptMessageHandler.script
)
configuration.userContentController.add(
scriptMessageHandler,
name: Braze.WebViewBridge.ScriptMessageHandler.name
)

// Create the webview using the configuration
let webView = WKWebView(frame: .zero, configuration: configuration)
```

## Example: Logging a custom event

In the following example, `BrazeBridge` is used to log a custom event from existing web content to the Braze Swift SDK.

```javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Logging data via BrazeBridge Example</title>
<script>
function logData(data) {
window.brazeBridge.logCustomEvent(data);
}
</script>
</head>

<body>
<input
type="button"
value="Click to log a custom Event 'completed_level'"
onclick="logData('completed_level')"
/>
</body>
</html>
```
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ braze.getUser().setDateOfBirth(2000, 12, 25);

## Assigning custom user attributes

In addition to our predefined user attribute methods, Braze also provides [custom attributes](https://www.braze.com/docs/user_guide/data_and_analytics/custom_data/custom_attributes/#custom-attribute-data-types) to track data from your applications.
In addition to our predefined user attribute methods, Braze also provides [custom attributes]({{site.baseurl}}/user_guide/data_and_analytics/custom_data/custom_attributes/#custom-attribute-data-types) to track data from your applications.

Full method specifications for custom attributes can be found here within the [JSDocs][1].

Expand Down
189 changes: 139 additions & 50 deletions _docs/_developer_guide/platform_wide/feature_flags/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,141 +283,230 @@ 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");
```

{% endtab %}
{% 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")
```

{% endtab %}
{% 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");
```

{% endtab %}
{% 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")
```

{% endtab %}
{% 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<String, dynamic> 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 %}

Expand Down
Loading