Skip to content

Commit

Permalink
Merge pull request #3905 from braze-inc/develop
Browse files Browse the repository at this point in the history
Deploy - August 9, 2022
  • Loading branch information
KellieHawks authored Aug 9, 2022
2 parents 1929f43 + 23bb5f5 commit 9abcdd8
Show file tree
Hide file tree
Showing 94 changed files with 2,970 additions and 307 deletions.
20 changes: 14 additions & 6 deletions .vercel/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@ let build_app = 1;
let branch_commit = process.env.VERCEL_GIT_COMMIT_REF || '';
let branch_check = process.env.BRANCH_CHECK || '';
let vercel_env = process.env.VERCEL_ENV || 'preview';
let vercel_lang = process.env.LANGUAGE || 'en';

// For develop and master branches, always build to make sure everything is updated
if ((vercel_env == 'preview') && (branch_commit != 'develop')) {
// For staging, check if it's a build from a language branch
// Cancel if it doesn't match expected branch
if (branch_check.includes('i18n_') || branch_commit.includes('i18n_')) {
// For preview, if language is english project, then don't build if it's an language branch
// if language is not english, then check if it's a language branch
if (vercel_lang == 'en') {
if (branch_check.includes('i18n_') || branch_commit.includes('i18n_')) {
build_app = 0;
}
}
else{
build_app = 0;
if (branch_check && (vercel_env == 'preview')) {
if (branch_commit == branch_check) {
build_app = 1;
if (branch_check.includes('i18n_') || branch_commit.includes('i18n_')) {
if (branch_check && (vercel_env == 'preview')) {
if (branch_commit == branch_check) {
build_app = 1;
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion _docs/_api/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ table td {

| Method | Endpoints |
| --- | --- |
| POST | [/subscription/status/set][/subscription/status/set] |
| POST | [/subscription/status/set][/subscription/status/set]<br>[/v2/subscription/status/set][/v2/subscription/status/set] |
| GET | [/subscription/status/get][/subscription/status/get]<br>[/subscription/user/status][/subscription/user/status] |
{: .reset-td-br-1 .reset-td-br-2}

Expand Down Expand Up @@ -158,6 +158,7 @@ table td {
[/subscription/status/set]: {{site.baseurl}}/api/endpoints/subscription_groups/post_update_user_subscription_group_status/
[/subscription/status/get]: {{site.baseurl}}/api/endpoints/subscription_groups/get_list_user_subscription_group_status/
[/subscription/user/status]: {{site.baseurl}}/api/endpoints/subscription_groups/get_list_user_subscription_groups/
[/v2/subscription/status/set]: {{site.baseurl}}/api/endpoints/subscription_groups/post_update_user_subscription_group_status_v2/

<!--- Links for email and email templates ---->
[/email/blacklist]: {{site.baseurl}}/api/endpoints/email/post_blacklist/
Expand Down
3 changes: 3 additions & 0 deletions _docs/_api/endpoints/subscription_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ guide_featured_list:
- name: "POST: Update User's Subscription Group Status"
link: /docs/api/endpoints/subscription_groups/post_update_user_subscription_group_status/
fa_icon: fas fa-user-plus
- name: "POST: Update User's Subscription Group Status V2"
link: /docs/api/endpoints/subscription_groups/post_update_user_subscription_group_status_v2/
fa_icon: fas fa-user-edit
---
<br>
<br>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page_type: reference
description: "This article outlines details about the Update User's Subscription Group Status Braze endpoint."
---
{% api %}
# Update users' subscription group status
# Update user's subscription group status
{% apimethod post core_endpoint|https://www.braze.com/docs/core_endpoints %}
/subscription/status/set
{% endapimethod %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
nav_title: "POST: Update User's Subscription Group Status V2"
permalink: /post_update_user_subscription_group_status_v2/
hidden: true
alias: /post_update_user_subscription_group_status_v2/
layout: api_page
page_type: reference
description: "This article outlines details about the Update User's Subscription Group Status Braze V2 endpoint."
Expand All @@ -12,7 +11,7 @@ channel:
---

{% api %}
# Update users' subscription group status
# Update user's subscription group status
{% apimethod post %}
/v2/subscription/status/set
{% endapimethod %}
Expand Down
6 changes: 6 additions & 0 deletions _docs/_developer_guide/developer_portal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
nav_title: Braze Developer Portal
layout: redirect
page_order: 0.1
redirect_to: https://www.braze.com/dev-portal
---
16 changes: 8 additions & 8 deletions _docs/_developer_guide/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
page_order: 0
layout: dev_guide
guide_top_header: "Braze Developer Guide"
guide_top_text: "This is where developers can find all the integrations available with Braze. You can also use the <a href='/docs/api/basics/'>REST API Guide</a>."
guide_top_text: "This is where developers can find all the integrations available with Braze.<br>For additional resources and to join the Braze developer community, visit the <a href='https://www.braze.com/dev-portal'>Braze developer portal</a>."
article_title: Braze Developer Guide

guide_featured_title: "Featured Integrations"
Expand All @@ -24,11 +24,11 @@ guide_menu_title: "All Integrations"
guide_menu_list:
- name: Cordova Android
link: /docs/developer_guide/platform_integration_guides/cordova/initial_sdk_setup/android/
fa_icon: fab fa-android
image: /assets/img/cordova.png
nav_link: cordova
- name: Cordova iOS
link: /docs/developer_guide/platform_integration_guides/cordova/initial_sdk_setup/ios/
fa_icon: fab fa-apple
image: /assets/img/cordova.png
nav_link: cordova
- name: Flutter Android and iOS
link: /docs/developer_guide/platform_integration_guides/flutter/flutter_sdk_integration/
Expand All @@ -48,27 +48,27 @@ guide_menu_list:
nav_link: macos
- name: Unity Android
link: /docs/developer_guide/platform_integration_guides/unity/sdk_integration/android/
fa_icon: fab fa-android
image: /assets/img/unity.png
nav_link: unity
- name: Unity iOS
link: /docs/developer_guide/platform_integration_guides/unity/sdk_integration/ios/
fa_icon: fab fa-apple
image: /assets/img/unity.png
nav_link: unity
- name: Windows Universal
link: /docs/developer_guide/platform_integration_guides/windows_universal/initial_sdk_setup/
fa_icon: fab fa-windows
nav_link: windowsuniversal
- name: Xamarin
link: /docs/developer_guide/platform_integration_guides/xamarin/initial_sdk_setup/
fa_icon: fas fa-times
image: /assets/img/xamarin.png
nav_link: xamarin
- name: Roku
link: /docs/developer_guide/platform_integration_guides/roku/initial_sdk_setup/
fa_icon: fas fa-tv
image: /assets/img/roku.png
nav_link: roku
- name: Unreal Engine
link: /docs/developer_guide/platform_integration_guides/unreal_engine/initial_sdk_setup/
fa_icon: fas fa-gamepad
image: /assets/img/unreal.png
nav_link: unrealengine

guide_footer_header: " "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ description: "This article covers how to configure uninstall tracking for your A

# Uninstall tracking for Android and FireOS

Uninstall tracking utilizes a silent push from Firebase Cloud Messaging to detect uninstalled devices. Starting in Braze Android SDK v3.1.0, we will intelligently drop the uninstall tracking notification and not wake up any custom broadcast receivers in your app with the regular silent push intent.
Uninstall tracking utilizes a silent push from Firebase Cloud Messaging to detect uninstalled devices. Braze will intelligently drop the uninstall tracking notification and not wake up any custom push callbacks in your app with the regular silent push intent.

If you wish to detect if the push notification is uninstall-tracking yourself, use [`isUninstallTrackingPush()`][3].

{% alert important %}
Since uninstall tracking silent push is not forwarded to your custom broadcast receiver, this method can only be used before the push notification is passed to Braze, such as when using a custom [Firebase Messaging Service]({{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration/#step-1-register-braze-firebase-messaging-service).
Since uninstall tracking silent push is not forwarded to any Braze push callbacks, this method can only be used before the push notification is passed to Braze, such as when using a custom [Firebase Messaging Service]({{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration/#step-1-register-braze-firebase-messaging-service).
{% endalert %}

If you have a custom [`Application`][1] subclass, make sure you do not have automatic logic that pings your servers in your [`Application.onCreate()`][2] lifecycle method. This is because a silent push will wake your app and instantiate the`Application` component if the app is not already running.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,52 @@ To override this value, set `com_braze_trigger_action_minimum_time_interval_seco

By default, in-app messages are triggered by custom events logged by the SDK. If you would like to trigger in-app messages by server-sent events, you can also achieve this.

To enable this feature, a silent push is sent to the device, which allows a custom push receiver to log an SDK-based event. This SDK event will subsequently trigger the user-facing in-app message.
To enable this feature, a silent push is sent to the device, which allows a custom push callback to log an SDK-based event. This SDK event will subsequently trigger the user-facing in-app message.

### Step 1: Register a custom BroadcastReceiver to log custom event
### Step 1: Create a Push Callback to Receive the Silent Push

Register your custom `BroadcastReceiver` to listen for a specific silent push within your `AndroidManifest.xml`. For more information on registering a custom `BroadcastReceiver` review [Braze's push documentation][78].
Register your custom push callback to listen for a specific silent push notification. For more information, take a look at [Braze's push documentation][78].

### Step 2: Create your BroadcastReceiver
Two events will be logged for the in-app message to be delivered, one by the server and one from within your custom push callback. To ensure the same event is not duplicated, the event logged from within your push callback should follow a generic naming convention, for example, "in-app message trigger event," and not the same name as the server sent event. If this is not done, segmentation and user data may be affected by duplicate events being logged for a single user action.

Your receiver will handle the intent broadcast by the silent push and log an SDK event. It will subclass `BroadcastReceiver` and override `onReceive()`. See [`EventBroadcastReceiver.java`][72] for a detailed example.
{% tabs %}
{% tab JAVA %}

```java
Braze.getInstance(context).subscribeToPushNotificationEvents(event -> {
final Bundle kvps = event.getNotificationPayload().getBrazeExtras();
if (kvps.containsKey("IS_SERVER_EVENT")) {
BrazeProperties eventProperties = new BrazeProperties();

// The campaign name is a string extra that clients can include in the push
String campaignName = kvps.getString("CAMPAIGN_NAME");
eventProperties.addProperty("campaign_name", campaignName);
Braze.getInstance(context).logCustomEvent("IAM Trigger", eventProperties);
}
});
```

{% endtab %}
{% tab KOTLIN %}

Two events will be logged for the in-app message to be delivered, one by the server and one from within your custom `BroadcastReceiver`. To ensure the same event is not duplicated, the event logged from within your `BroadcastReceiver` should follow a generic naming convention, for example, "in-app message trigger event," and not the same name as the server sent event. If this is not done, segmentation and user data may be affected by duplicate events being logged for a single user action.
```kotlin
Braze.getInstance(applicationContext).subscribeToPushNotificationEvents { event ->
val kvps = event.notificationPayload.brazeExtras
if (kvps.containsKey("IS_SERVER_EVENT")) {
val eventProperties = BrazeProperties()

// The campaign name is a string extra that clients can include in the push
val campaignName = kvps.getString("CAMPAIGN_NAME")
eventProperties.addProperty("campaign_name", campaignName)
Braze.getInstance(applicationContext).logCustomEvent("IAM Trigger", eventProperties)
}
}
```

For further details on custom handling push receipts, opens, and key-value pairs, review [Braze's push documentation][78].
{% endtab %}
{% endtabs %}

### Step 3: Create a push campaign
### Step 2: Create a push campaign

Create a [silent push campaign][73] triggered via the server sent event.

Expand All @@ -67,13 +98,13 @@ The push campaign must include key-value pair extras that indicate that this pus

![Two sets of key-value pairs: IS_SERVER_EVENT set to "true", and CAMPAIGN_NAME set to "example campaign name".][76]{: style="max-width:70%;" }

The [`EventBroadcastReceiver.java`][72] recognizes the key-value pairs and logs the appropriate SDK custom event.
The earlier push callback sample code recognizes the key-value pairs and logs the appropriate SDK custom event.

Should you want to include any event properties to attach to your "in-app message trigger" event, you can achieve this by passing these in the key-value pairs of the push payload. In this example, the campaign name of the subsequent in-app message has been included. Your custom `BroadcastReceiver` can then pass the value as the parameter of the event property when logging the custom event.
Should you want to include any event properties to attach to your "in-app message trigger" event, you can achieve this by passing these in the key-value pairs of the push payload. In this example, the campaign name of the subsequent in-app message has been included. Your custom push callback can then pass the value as the parameter of the event property when logging the custom event.

### Step 4: Create an in-app message campaign
### Step 3: Create an in-app message campaign

Create your user-visible in-app message campaign from within Braze’s dashboard. This campaign should have an action-based delivery and be triggered from the custom event logged from within the custom [`EventBroadcastReceiver.java`][72].
Create your user-visible in-app message campaign from within Braze’s dashboard. This campaign should have an action-based delivery and be triggered from the custom event logged from within your custom push callback.

In the following example, the specific in-app message to be triggered has been configured by sending the event property as part of the initial silent push.

Expand Down Expand Up @@ -131,10 +162,9 @@ BrazeInAppMessageManager.getInstance().addInAppMessage(inAppMessage)
{% endtab %}
{% endtabs %}

[72]: https://gist.github.com/robbiematthews/1d037e2c366e523b2dda5f2e053ea2a9
[73]: {{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/silent_push_notifications/
[75]: {% image_buster /assets/img_archive/serverSentPush.png %}
[76]: {% image_buster /assets/img_archive/kvpConfiguration.png %}
[77]: {% image_buster /assets/img_archive/iam_event_trigger.png %}
[78]: {{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration/#custom-handling-for-push-receipts-opens-dismissals-and-key-value-pairs
[78]: {{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration/#android-push-listener-callback
[84]: {{site.baseurl}}/developer_guide/platform_integration_guides/android/analytics/tracking_sessions/#session-lifecycle
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ While not a native feature, Android TV push integration is made possible by leve
1. **Integrate the Braze Android SDK**<br>
First, you must integrate the [Braze Android SDK][6] (If not already completed).<br><br>
2. **Integrate push notifications**<br>
Next, you must integrate the [Android Push Notifications][10] (If not already completed).<br><br>
Next, you must integrate [Android Push Notifications][10] (If not already completed).<br><br>
3. **Create a custom toast view**<br>
Next, you will need to create a [custom toast view][9] for the app to display your notifications.<br><br>
Next, create a custom view in your app to display your notifications.<br><br>
4. **Create a custom notification factory**<br>
Lastly, you must create a [custom notification factory][8]. This will override the default SDK behavior and allow you to manually display the notifications. By returning `null`, this will prevent the SDK from processing and will require custom code to display the notification. Once these steps have been completed, you can start sending push to Android TV!<br><br>
5. **Set up click analytics tracking (optional)**<br>
To track click analytics effectively, it is necessary to handle this manually, as Braze does not handle the display of the messages automatically. This can be achieved by creating a [custom `BroadcastReceiver`][7] to listen for Braze push opened and received intents.
To track click analytics effectively, it is necessary to handle this manually, as Braze does not handle the display of the messages automatically. This can be achieved by creating a [push callback][7] to listen for Braze push opened and received intents.

{% alert note %}
Note that these notifications **will not persist** and will only be visible to the user when the device displays them. This is due to Android TV's notification center not supporting historical notifications.
Expand All @@ -45,7 +45,7 @@ For a marketing end user in Braze, launching a campaign to Android TV will be id
The delivered and clicked response returned by FCM will follow the same convention as a mobile Android device; therefore, any errors will be visible in the message activity log.

[6]: {{site.baseurl}}/developer_guide/platform_integration_guides/android/initial_sdk_setup/android_sdk_integration/?redirected=true
[7]: {{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration/#custom-handling-for-push-receipts-opens-dismissals-and-key-value-pairs
[7]: {{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration/#android-push-listener-callback
[8]: {{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration/#custom-displaying-notifications
[9]: https://developer.android.com/guide/topics/ui/notifiers/toasts#CustomToastView
[10]: {{site.baseurl}}/developer_guide/platform_integration_guides/android/push_notifications/android/integration/standard_integration/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ guide_featured_list:
- name: Advanced Settings
link: /docs/developer_guide/platform_integration_guides/android/push_notifications/android/customization/advanced_settings/
fa_icon: fa fa-cog
- name: Custom Broadcast Receiver
link: /docs/developer_guide/platform_integration_guides/android/push_notifications/android/customization/custom_broadcast_receiver/
fa_icon: fa fa-cog


---
<br><br>
<br><br>
Loading

2 comments on commit 9abcdd8

@vercel
Copy link

@vercel vercel bot commented on 9abcdd8 Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

braze-docs-fr – ./

braze-docs-fr-braze.vercel.app
braze-docs-fr-git-master-braze.vercel.app
braze-docs-fr.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 9abcdd8 Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

braze-docs-en – ./

braze-docs-en.vercel.app
braze-docs-en-braze.vercel.app
braze-docs-en-git-master-braze.vercel.app

Please sign in to comment.