From 279a1d3e8221a650bb3a68a724c1a2cdbf6e719a Mon Sep 17 00:00:00 2001 From: Jeriel Ng Date: Fri, 24 May 2024 15:48:18 -0400 Subject: [PATCH 1/5] Add clarifying note for iOS push action buttons --- .../push_notifications/customization/action_buttons.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md index b924ede4392..7886ee134d3 100644 --- a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md +++ b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md @@ -137,9 +137,13 @@ UNNotificationCategory *likeCategory = [UNNotificationCategory categoryWithIdent {% endtab %} {% endtabs %} -Once you register categories in your application, use the Braze dashboard to send notifications of that type to your users. Define your custom notification category in **Compose** step of the push composer. +Once you register categories in your application, use the Braze dashboard to send notifications of that type to your users. Define your custom notification category in the **Compose** step of the push composer. -1. Make sure **Action Buttons** are turned on. +{% alert note %} +Defining custom notification categories on the Braze dashboard is only required for action buttons that have special actions, like deeplinking into the application or opening a web URL. If you are creating an action button that simply dismisses a notification, you only need to define that action in your iOS application code and may skip this step for such buttons. +{% endalert %} + +1. Make sure **Action Buttons** are turned on. 2. For **iOS Notification Category**, select **Enter pre-registered custom iOS Category**. 3. Enter the category you previously defined (for example `LIKE_CATEGORY`). From 250d3173f8b0cef9dcf311fd8fff5f578172c139 Mon Sep 17 00:00:00 2001 From: Jeriel Ng Date: Fri, 24 May 2024 16:09:38 -0400 Subject: [PATCH 2/5] Update phrasing --- .../swift/push_notifications/customization/action_buttons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md index 7886ee134d3..ecbd5f4ce94 100644 --- a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md +++ b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md @@ -140,7 +140,7 @@ UNNotificationCategory *likeCategory = [UNNotificationCategory categoryWithIdent Once you register categories in your application, use the Braze dashboard to send notifications of that type to your users. Define your custom notification category in the **Compose** step of the push composer. {% alert note %} -Defining custom notification categories on the Braze dashboard is only required for action buttons that have special actions, like deeplinking into the application or opening a web URL. If you are creating an action button that simply dismisses a notification, you only need to define that action in your iOS application code and may skip this step for such buttons. +Defining custom notification categories on the Braze dashboard is only required for action buttons that have special actions, like deeplinking into the application or opening a web URL. You do not need to define click behavior for action buttons that simply dismiss a notification. {% endalert %} 1. Make sure **Action Buttons** are turned on. From 2c4acdaf5b13124060a7ed255694e9689c40e3ec Mon Sep 17 00:00:00 2001 From: Jeriel Ng Date: Fri, 31 May 2024 15:22:08 -0400 Subject: [PATCH 3/5] Update _docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md Co-authored-by: Jackson Miller <71667842+jacksonemiller@users.noreply.github.com> --- .../swift/push_notifications/customization/action_buttons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md index ecbd5f4ce94..2be673b03c7 100644 --- a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md +++ b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md @@ -140,7 +140,7 @@ UNNotificationCategory *likeCategory = [UNNotificationCategory categoryWithIdent Once you register categories in your application, use the Braze dashboard to send notifications of that type to your users. Define your custom notification category in the **Compose** step of the push composer. {% alert note %} -Defining custom notification categories on the Braze dashboard is only required for action buttons that have special actions, like deeplinking into the application or opening a web URL. You do not need to define click behavior for action buttons that simply dismiss a notification. +Defining custom notification categories on the Braze dashboard is only required for action buttons that have special actions, like deep linking into the application or opening a web URL. You do not need to define click behavior for action buttons that simply dismiss a notification. {% endalert %} 1. Make sure **Action Buttons** are turned on. From 07a8834d22efa75a5774f38bde0b8c5d3394fd71 Mon Sep 17 00:00:00 2001 From: Isaiah Robinson <95643215+internetisaiah@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:04:21 -0700 Subject: [PATCH 4/5] tech writer edits --- .../customization/action_buttons.md | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md index 2be673b03c7..b03263fae5d 100644 --- a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md +++ b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md @@ -88,13 +88,9 @@ Here's an example that leverages the `LIKE_CATEGORY` displayed on the device: ![A push message displaying two push action buttons "unlike" and "like".][17] -To register categories in your application, refer to the following code snippet: +#### Step 1: Register a category -{% alert note %} -When creating a `UNNotificationAction`, you may specify a list of action options. For example, adding `UNNotificationActionOptions.foreground` allows your users to open the app upon clicking the action button, which is necessary for Braze on-click behaviors that navigate into your app, such as "Open App" and "Deep Link into Application". - -Refer to [`UNNotificationActionOptions`](https://developer.apple.com/documentation/usernotifications/unnotificationactionoptions) for further usage details. -{% endalert %} +To register a category in your app, use a similar approach to the following: {% tabs %} {% tab swift %} @@ -117,19 +113,20 @@ UNUserNotificationCenter.current().setNotificationCategories(Braze.Notifications ```objc NSMutableSet *categories = [BRZNotifications.categories mutableCopy]; + UNNotificationAction *likeAction = [UNNotificationAction actionWithIdentifier:@"LIKE_IDENTIFIER" title:@"Like" options:UNNotificationActionOptionForeground]; + UNNotificationAction *unlikeAction = [UNNotificationAction actionWithIdentifier:@"UNLIKE_IDENTIFIER" title:@"Unlike" options:UNNotificationActionOptionForeground]; + UNNotificationCategory *likeCategory = [UNNotificationCategory categoryWithIdentifier:@"LIKE_CATEGORY" - actions:@[likeAction, - unlikeAction - ] + actions:@[likeAction, unlikeAction] intentIdentifiers:@[] - options:UNNotificationCategoryOptionNone -]; + options:UNNotificationCategoryOptionNone]; + [categories addObject:likeCategory]; [UNUserNotificationCenter.currentNotificationCenter setNotificationCategories:categories]; ``` @@ -137,15 +134,22 @@ UNNotificationCategory *likeCategory = [UNNotificationCategory categoryWithIdent {% endtab %} {% endtabs %} -Once you register categories in your application, use the Braze dashboard to send notifications of that type to your users. Define your custom notification category in the **Compose** step of the push composer. - {% alert note %} -Defining custom notification categories on the Braze dashboard is only required for action buttons that have special actions, like deep linking into the application or opening a web URL. You do not need to define click behavior for action buttons that simply dismiss a notification. +When you create a `UNNotificationAction`, you can specify a list of action options. For example, `UNNotificationActionOptions.foreground` let's your users open your app after tapping the action button. This is necessary for navigational on-click behaviors, such as "Open App" and "Deep Link into Application". For more information, see [`UNNotificationActionOptions`](https://developer.apple.com/documentation/usernotifications/unnotificationactionoptions). +{% endalert %} + +#### Step 2: Select your categories + +After you register a category, use the Braze dashboard to send notifications of that type to users. + +{% alert tip %} +You only need to define custom notification categories for action buttons with _special actions_, such as deep linking into your app or opening a URL. {% endalert %} -1. Make sure **Action Buttons** are turned on. -2. For **iOS Notification Category**, select **Enter pre-registered custom iOS Category**. -3. Enter the category you previously defined (for example `LIKE_CATEGORY`). +1. In the Braze dashboard, select **Messaging** > **Push Notifications**, then choose your iOS [push campaign]({{site.baseurl}}/docs/user_guide/message_building_by_channel/push/creating_a_push_message). +2. Under **Compose push notification**, turn on **Action Buttons**. +3. In the **iOS Notification Category** dropdown, select **Enter pre-registered custom iOS Category**. +4. Finally, enter one of the categories you created earlier. The following example, uses the custom category: `LIKE_CATEGORY`. ![The push notification campaign dashboard with the setup for custom categories.][18] From 4d1b0de5b87369878e49a921c26e222ad5b85d49 Mon Sep 17 00:00:00 2001 From: Isaiah Robinson <95643215+internetisaiah@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:06:17 -0700 Subject: [PATCH 5/5] tech writer edits --- .../swift/push_notifications/customization/action_buttons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md index b03263fae5d..8a765c16ee8 100644 --- a/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md +++ b/_docs/_developer_guide/platform_integration_guides/swift/push_notifications/customization/action_buttons.md @@ -143,7 +143,7 @@ When you create a `UNNotificationAction`, you can specify a list of action optio After you register a category, use the Braze dashboard to send notifications of that type to users. {% alert tip %} -You only need to define custom notification categories for action buttons with _special actions_, such as deep linking into your app or opening a URL. +You only need to define custom notification categories for action buttons with _special actions_, such as deep linking into your app or opening a URL. You do not need to define them for action buttons that only dismiss a notification. {% endalert %} 1. In the Braze dashboard, select **Messaging** > **Push Notifications**, then choose your iOS [push campaign]({{site.baseurl}}/docs/user_guide/message_building_by_channel/push/creating_a_push_message).