From 2f594eca3a74c73521ead784bebab094c4057dee Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 4 Nov 2024 17:56:04 -0500 Subject: [PATCH 1/5] WIP 11/04/24 17:56:04 --- .../android_google_tag_manager.md | 79 +++++++++---------- .../android/analytics/location_tracking.md | 11 ++- 2 files changed, 47 insertions(+), 43 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/android/advanced_use_cases/android_google_tag_manager.md b/_docs/_developer_guide/platform_integration_guides/android/advanced_use_cases/android_google_tag_manager.md index 2eab41629db..cd9fac5af79 100644 --- a/_docs/_developer_guide/platform_integration_guides/android/advanced_use_cases/android_google_tag_manager.md +++ b/_docs/_developer_guide/platform_integration_guides/android/advanced_use_cases/android_google_tag_manager.md @@ -70,7 +70,7 @@ mFirebaseAnalytics.logEvent("played song", params); val params = Bundle() params.putString("genre", "pop") params.putInt("number of times listened", 42); -mFirebaseAnalytics!!logEvent("played song", params) +mFirebaseAnalytics.logEvent("played song", params) ``` {% endtab %} @@ -97,7 +97,7 @@ mFirebaseAnalytics.logEvent("customAttribute", params); val params = Bundle() params.putString("customAttributeKey", "favorite song") params.putString("customAttributeValue", "Private Eyes") -mFirebaseAnalytics!!.logEvent("customAttribute", params) +mFirebaseAnalytics.logEvent("customAttribute", params) ``` {% endtab %} @@ -122,7 +122,7 @@ mFirebaseAnalytics.logEvent("changeUser", params); ```kotlin val params = Bundle() params.putString("externalUserId", userId) -mFirebaseAnalytics!!.logEvent("changeUser", params) +mFirebaseAnalytics.logEvent("changeUser", params) ``` {% endtab %} @@ -241,28 +241,27 @@ public class BrazeGtmTagProvider implements CustomTagProvider { String key = String.valueOf(tagParameterMap.get(CUSTOM_ATTRIBUTE_KEY)); Object value = tagParameterMap.get(CUSTOM_ATTRIBUTE_VALUE_KEY); - BrazeUser brazeUser = Braze.getInstance(sApplicationContext).getCurrentUser(); - if (brazeUser == null) { - BrazeLogger.w(TAG, "BrazeUser was null. Returning."); - return; - } - - if (value instanceof Boolean) { - brazeUser.setCustomUserAttribute(key, (Boolean) value); - } else if (value instanceof Integer) { - brazeUser.setCustomUserAttribute(key, (Integer) value); - } else if (value instanceof Long) { - brazeUser.setCustomUserAttribute(key, (Long) value); - } else if (value instanceof String) { - brazeUser.setCustomUserAttribute(key, (String) value); - } else if (value instanceof Double) { - brazeUser.setCustomUserAttribute(key, (Double) value); - } else if (value instanceof Float) { - brazeUser.setCustomUserAttribute(key, (Float) value); - } else { - BrazeLogger.w(TAG, "Failed to parse value into a custom " - + "attribute accepted type. Key: '" + key + "' Value: '" + value + "'"); - } + Braze.getInstance(sApplicationContext).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + if (value instanceof Boolean) { + brazeUser.setCustomUserAttribute(key, (Boolean) value); + } else if (value instanceof Integer) { + brazeUser.setCustomUserAttribute(key, (Integer) value); + } else if (value instanceof Long) { + brazeUser.setCustomUserAttribute(key, (Long) value); + } else if (value instanceof String) { + brazeUser.setCustomUserAttribute(key, (String) value); + } else if (value instanceof Double) { + brazeUser.setCustomUserAttribute(key, (Double) value); + } else if (value instanceof Float) { + brazeUser.setCustomUserAttribute(key, (Float) value); + } else { + BrazeLogger.w(TAG, "Failed to parse value into a custom " + + "attribute accepted type. Key: '" + key + "' Value: '" + value + "'"); + } + } + }); } private void changeUser(Map tagParameterMap) { @@ -329,21 +328,19 @@ class BrazeGtmTagProvider : CustomTagProvider { val key = tagParameterMap[CUSTOM_ATTRIBUTE_KEY].toString() val value = tagParameterMap[CUSTOM_ATTRIBUTE_VALUE_KEY] - val brazeUser = Braze.getInstance(sApplicationContext).currentUser - if (brazeUser == null) { - BrazeLogger.w(TAG, "BrazeUser was null. Returning.") - return - } - - when (value) { - is Boolean -> brazeUser.setCustomUserAttribute(key, (value as Boolean?)!!) - is Int -> brazeUser.setCustomUserAttribute(key, (value as Int?)!!) - is Long -> brazeUser.setCustomUserAttribute(key, (value as Long?)!!) - is String -> brazeUser.setCustomUserAttribute(key, value as String?) - is Double -> brazeUser.setCustomUserAttribute(key, (value as Double?)!!) - is Float -> brazeUser.setCustomUserAttribute(key, (value as Float?)!!) - else -> BrazeLogger.w(TAG, "Failed to parse value into a custom " - + "attribute accepted type. Key: '" + key + "' Value: '" + value + "'") + Braze.getInstance(sApplicationContext).getCurrentUser { brazeUser -> + when (value) { + is Boolean -> brazeUser.setCustomUserAttribute(key, value) + is Int -> brazeUser.setCustomUserAttribute(key, value) + is Long -> brazeUser.setCustomUserAttribute(key, value) + is String -> brazeUser.setCustomUserAttribute(key, value) + is Double -> brazeUser.setCustomUserAttribute(key, value) + is Float -> brazeUser.setCustomUserAttribute(key, value) + else -> BrazeLogger.w( + TAG, "Failed to parse value into a custom " + + "attribute accepted type. Key: '" + key + "' Value: '" + value + "'" + ) + } } } @@ -353,7 +350,7 @@ class BrazeGtmTagProvider : CustomTagProvider { } companion object { - private val TAG = BrazeLogger.getBrazeLogTag(BrazeGtmTagProvider::class.java!!) + private val TAG = BrazeLogger.getBrazeLogTag(BrazeGtmTagProvider::class.java) private val ACTION_TYPE_KEY = "actionType" // Custom Events diff --git a/_docs/_developer_guide/platform_integration_guides/android/analytics/location_tracking.md b/_docs/_developer_guide/platform_integration_guides/android/analytics/location_tracking.md index 7d672347375..2134a2c38c3 100644 --- a/_docs/_developer_guide/platform_integration_guides/android/analytics/location_tracking.md +++ b/_docs/_developer_guide/platform_integration_guides/android/analytics/location_tracking.md @@ -75,14 +75,21 @@ Even when automatic tracking is disabled, you can manually log single location d {% tab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setLastKnownLocation(LATITUDE_DOUBLE_VALUE, LONGITUDE_DOUBLE_VALUE, ALTITUDE_DOUBLE_VALUE, ACCURACY_DOUBLE_VALUE); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setLastKnownLocation(LATITUDE_DOUBLE_VALUE, LONGITUDE_DOUBLE_VALUE, ALTITUDE_DOUBLE_VALUE, ACCURACY_DOUBLE_VALUE); + } +} ``` {% endtab %} {% tab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setLastKnownLocation(LATITUDE_DOUBLE_VALUE, LONGITUDE_DOUBLE_VALUE, ALTITUDE_DOUBLE_VALUE, ACCURACY_DOUBLE_VALUE) +Braze.getInstance(sApplicationContext).getCurrentUser { brazeUser -> + brazeUser.setLastKnownLocation(LATITUDE_DOUBLE_VALUE, LONGITUDE_DOUBLE_VALUE, ALTITUDE_DOUBLE_VALUE, ACCURACY_DOUBLE_VALUE) +} ``` {% endtab %} From 5fd077479b7c636f7fc2562020f929573079e8ac Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 5 Nov 2024 15:45:23 -0500 Subject: [PATCH 2/5] WIP 11/05/24 15:45:23 --- .../android/analytics/location_tracking.md | 2 +- .../analytics/setting_custom_attributes.md | 152 +++++++++++++----- 2 files changed, 112 insertions(+), 42 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/android/analytics/location_tracking.md b/_docs/_developer_guide/platform_integration_guides/android/analytics/location_tracking.md index 2134a2c38c3..c023b9a5092 100644 --- a/_docs/_developer_guide/platform_integration_guides/android/analytics/location_tracking.md +++ b/_docs/_developer_guide/platform_integration_guides/android/analytics/location_tracking.md @@ -87,7 +87,7 @@ Braze.getInstance(context).getCurrentUser(new IValueCallback() { {% tab KOTLIN %} ```kotlin -Braze.getInstance(sApplicationContext).getCurrentUser { brazeUser -> +Braze.getInstance(context).getCurrentUser { brazeUser -> brazeUser.setLastKnownLocation(LATITUDE_DOUBLE_VALUE, LONGITUDE_DOUBLE_VALUE, ALTITUDE_DOUBLE_VALUE, ACCURACY_DOUBLE_VALUE) } ``` diff --git a/_docs/_developer_guide/platform_integration_guides/android/analytics/setting_custom_attributes.md b/_docs/_developer_guide/platform_integration_guides/android/analytics/setting_custom_attributes.md index c15e36d92ab..f16fecd34d7 100644 --- a/_docs/_developer_guide/platform_integration_guides/android/analytics/setting_custom_attributes.md +++ b/_docs/_developer_guide/platform_integration_guides/android/analytics/setting_custom_attributes.md @@ -41,14 +41,21 @@ All string values such as first name, last name, country, and home city are limi {% tab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setFirstName("first_name"); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setFirstName("first_name"); + } +} ``` {% endtab %} {% tab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setFirstName("first_name") +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setFirstName("first_name") +} ``` {% endtab %} @@ -62,14 +69,21 @@ Braze.getInstance(context).currentUser?.setFirstName("first_name") {% subtab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setCustomUserAttribute("your_attribute_key", "your_attribute_value"); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setCustomUserAttribute("your_attribute_key", "your_attribute_value"); + } +} ``` {% endsubtab %} {% subtab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_key", "your_attribute_value") +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setCustomUserAttribute("your_attribute_key", "your_attribute_value") +} ``` {% endsubtab %} @@ -80,18 +94,27 @@ Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_k {% subtab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setCustomUserAttribute("your_attribute_key", YOUR_INT_VALUE); -// Integer attributes may also be incremented using code like the following: -Braze.getInstance(context).getCurrentUser().incrementCustomUserAttribute("your_attribute_key", YOUR_INCREMENT_VALUE); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_INT_VALUE); + + // Integer attributes may also be incremented using code like the following: + brazeUser.incrementCustomUserAttribute("your_attribute_key", YOUR_INCREMENT_VALUE); + } +} ``` {% endsubtab %} {% subtab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_key", YOUR_INT_VALUE) -// Integer attributes may also be incremented using code like the following: -Braze.getInstance(context).currentUser?.incrementCustomUserAttribute("your_attribute_key", YOUR_INCREMENT_VALUE) +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_INT_VALUE) + + // Integer attributes may also be incremented using code like the following: + brazeUser.incrementCustomUserAttribute("your_attribute_key", YOUR_INCREMENT_VALUE) +} ``` {% endsubtab %} @@ -102,14 +125,21 @@ Braze.getInstance(context).currentUser?.incrementCustomUserAttribute("your_attri {% subtab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setCustomUserAttribute("your_attribute_key", YOUR_BOOLEAN_VALUE); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_BOOLEAN_VALUE); + } +}); ``` {% endsubtab %} {% subtab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_key", YOUR_BOOLEAN_VALUE) +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_BOOLEAN_VALUE) +} ``` {% endsubtab %} @@ -120,14 +150,21 @@ Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_k {% subtab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setCustomUserAttribute("your_attribute_key", YOUR_LONG_VALUE); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_LONG_VALUE); + } +}); ``` {% endsubtab %} {% subtab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_key", YOUR_LONG_VALUE) +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_LONG_VALUE) +} ``` {% endsubtab %} @@ -138,14 +175,21 @@ Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_k {% subtab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setCustomUserAttribute("your_attribute_key", YOUR_FLOAT_VALUE); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_FLOAT_VALUE); + } +}); ``` {% endsubtab %} {% subtab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_key", YOUR_FLOAT_VALUE) +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_FLOAT_VALUE) +} ``` {% endsubtab %} @@ -156,14 +200,21 @@ Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_k {% subtab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setCustomUserAttribute("your_attribute_key", YOUR_DOUBLE_VALUE); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_DOUBLE_VALUE); + } +}); ``` {% endsubtab %} {% subtab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_key", YOUR_DOUBLE_VALUE) +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_DOUBLE_VALUE) +} ``` {% endsubtab %} @@ -174,22 +225,29 @@ Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_k {% subtab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setCustomUserAttribute("your_attribute_key", YOUR_DATE_VALUE); -// This method will assign the current time to a custom attribute at the time the method is called: -Braze.getInstance(context).getCurrentUser().setCustomUserAttributeToNow("your_attribute_key"); -// This method will assign the date specified by SECONDS_FROM_EPOCH to a custom attribute: -Braze.getInstance(context).getCurrentUser().setCustomUserAttributeToSecondsFromEpoch("your_attribute_key", SECONDS_FROM_EPOCH); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_DATE_VALUE); + // This method will assign the current time to a custom attribute at the time the method is called: + brazeUser.setCustomUserAttributeToNow("your_attribute_key"); + // This method will assign the date specified by SECONDS_FROM_EPOCH to a custom attribute: + brazeUser.setCustomUserAttributeToSecondsFromEpoch("your_attribute_key", SECONDS_FROM_EPOCH); + } +}); ``` {% endsubtab %} {% subtab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setCustomUserAttribute("your_attribute_key", YOUR_DATE_VALUE) -// This method will assign the current time to a custom attribute at the time the method is called: -Braze.getInstance(context).currentUser?.setCustomUserAttributeToNow("your_attribute_key") -// This method will assign the date specified by SECONDS_FROM_EPOCH to a custom attribute: -Braze.getInstance(context).currentUser?.setCustomUserAttributeToSecondsFromEpoch("your_attribute_key", SECONDS_FROM_EPOCH) +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setCustomUserAttribute("your_attribute_key", YOUR_DATE_VALUE) + // This method will assign the current time to a custom attribute at the time the method is called: + brazeUser.setCustomUserAttributeToNow("your_attribute_key") + // This method will assign the date specified by SECONDS_FROM_EPOCH to a custom attribute: + brazeUser.setCustomUserAttributeToSecondsFromEpoch("your_attribute_key", SECONDS_FROM_EPOCH) +} ``` {% endsubtab %} @@ -208,23 +266,30 @@ The maximum number of elements in custom attribute arrays defaults to 25. The ma {% subtab JAVA %} ```java -// Setting a custom attribute with an array value -Braze.getInstance(context).getCurrentUser().setCustomAttributeArray("your_attribute_key", testSetArray); -// Adding to a custom attribute with an array value -Braze.getInstance(context).getCurrentUser().addToCustomAttributeArray("your_attribute_key", "value_to_add"); -// Removing a value from an array type custom attribute -Braze.getInstance(context).getCurrentUser().removeFromCustomAttributeArray("your_attribute_key", "value_to_remove"); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + // Setting a custom attribute with an array value + brazeUser.setCustomAttributeArray("your_attribute_key", testSetArray); + // Adding to a custom attribute with an array value + brazeUser.addToCustomAttributeArray("your_attribute_key", "value_to_add"); + // Removing a value from an array type custom attribute + brazeUser.removeFromCustomAttributeArray("your_attribute_key", "value_to_remove"); + } +}); ``` {% endsubtab %} {% subtab KOTLIN %} ```kotlin -// Setting a custom attribute with an array value -Braze.getInstance(context).currentUser?.setCustomAttributeArray("your_attribute_key", testSetArray) -// Adding to a custom attribute with an array value -Braze.getInstance(context).currentUser?.addToCustomAttributeArray("your_attribute_key", "value_to_add") -// Removing a value from an array type custom attribute -Braze.getInstance(context).currentUser?.removeFromCustomAttributeArray("your_attribute_key", "value_to_remove") +Braze.getInstance(context).getCurrentUser { brazeUser -> + // Setting a custom attribute with an array value + brazeUser.setCustomAttributeArray("your_attribute_key", testSetArray) + // Adding to a custom attribute with an array value + brazeUser.addToCustomAttributeArray("your_attribute_key", "value_to_add") + // Removing a value from an array type custom attribute + brazeUser.removeFromCustomAttributeArray("your_attribute_key", "value_to_remove") +} ``` {% endsubtab %} @@ -240,7 +305,12 @@ Custom attributes can also be unset using the following method: {% tab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().unsetCustomUserAttribute("your_attribute_key"); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.unsetCustomUserAttribute("your_attribute_key"); + } +}); ``` {% endtab %} From 38c22a93f79902023bdf498735365550e910cd14 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 5 Nov 2024 15:57:34 -0500 Subject: [PATCH 3/5] WIP 11/05/24 15:57:33 --- .../analytics/setting_custom_attributes.md | 26 +++++++++++++++---- .../in-app_messaging/implementation_guide.md | 14 ++++++---- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/android/analytics/setting_custom_attributes.md b/_docs/_developer_guide/platform_integration_guides/android/analytics/setting_custom_attributes.md index f16fecd34d7..07ff479c7c9 100644 --- a/_docs/_developer_guide/platform_integration_guides/android/analytics/setting_custom_attributes.md +++ b/_docs/_developer_guide/platform_integration_guides/android/analytics/setting_custom_attributes.md @@ -317,7 +317,9 @@ Braze.getInstance(context).getCurrentUser(new IValueCallback() { {% tab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.unsetCustomUserAttribute("your_attribute_key") +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.unsetCustomUserAttribute("your_attribute_key") +} ``` {% endtab %} @@ -348,14 +350,21 @@ No explicit opt-in is required by Android to send users push notifications. When {% tab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setEmailNotificationSubscriptionType(emailNotificationSubscriptionType); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setEmailNotificationSubscriptionType(emailNotificationSubscriptionType); + } +}); ``` {% endtab %} {% tab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setEmailNotificationSubscriptionType(emailNotificationSubscriptionType) +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setEmailNotificationSubscriptionType(emailNotificationSubscriptionType) +} ``` {% endtab %} @@ -367,14 +376,21 @@ Braze.getInstance(context).currentUser?.setEmailNotificationSubscriptionType(ema {% tab JAVA %} ```java -Braze.getInstance(context).getCurrentUser().setPushNotificationSubscriptionType(pushNotificationSubscriptionType); +Braze.getInstance(context).getCurrentUser(new IValueCallback() { + @Override + public void onSuccess(BrazeUser brazeUser) { + brazeUser.setPushNotificationSubscriptionType(pushNotificationSubscriptionType); + } +}); ``` {% endtab %} {% tab KOTLIN %} ```kotlin -Braze.getInstance(context).currentUser?.setPushNotificationSubscriptionType(pushNotificationSubscriptionType) +Braze.getInstance(context).getCurrentUser { brazeUser -> + brazeUser.setPushNotificationSubscriptionType(pushNotificationSubscriptionType) +} ``` {% endtab %} diff --git a/_docs/_developer_guide/platform_integration_guides/android/in-app_messaging/implementation_guide.md b/_docs/_developer_guide/platform_integration_guides/android/in-app_messaging/implementation_guide.md index 282efc55a40..02444765c84 100644 --- a/_docs/_developer_guide/platform_integration_guides/android/in-app_messaging/implementation_guide.md +++ b/_docs/_developer_guide/platform_integration_guides/android/in-app_messaging/implementation_guide.md @@ -331,8 +331,10 @@ Using the view subclass, after a user presses submit, pass the attribute with it ```kotlin override fun onClick(v: View?) { - val selectedTeam = spinner.selectedItem as String; - Braze.getInstance(ctx).getCurrentUser()?.setCustomUserAttribute("FavoriteTeam", selectedTeam) + val selectedTeam = spinner.selectedItem as String + Braze.getInstance(ctx).getCurrentUser { brazeUser -> + brazeUser?.setCustomUserAttribute("FavoriteTeam", selectedTeam) + } messageClickableView.performClick() } ``` @@ -344,9 +346,11 @@ Using the view subclass, after a user presses submit, pass the attribute with it ```java @Override public void onClick(View v) { - String selectedTeam = (String)spinner.selectedItem ; - Braze.getInstance(ctx).getCurrentUser().setCustomUserAttribute("FavoriteTeam", selectedTeam) - messageClickableView.performClick() + Braze.getInstance(ctx).getCurrentUser(brazeUser -> { + String selectedTeam = (String) spinner.getSelectedItem(); + brazeUser.setCustomUserAttribute("FavoriteTeam", selectedTeam); + messageClickableView.performClick(); + }); } ``` {% endtab %} From cbba836d6169f7046102c57cf3677a78b798e532 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 5 Nov 2024 16:11:17 -0500 Subject: [PATCH 4/5] WIP 11/05/24 16:11:17 --- .../android/in-app_messaging/implementation_guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_docs/_developer_guide/platform_integration_guides/android/in-app_messaging/implementation_guide.md b/_docs/_developer_guide/platform_integration_guides/android/in-app_messaging/implementation_guide.md index 02444765c84..354508bdd6c 100644 --- a/_docs/_developer_guide/platform_integration_guides/android/in-app_messaging/implementation_guide.md +++ b/_docs/_developer_guide/platform_integration_guides/android/in-app_messaging/implementation_guide.md @@ -332,10 +332,10 @@ Using the view subclass, after a user presses submit, pass the attribute with it ```kotlin override fun onClick(v: View?) { val selectedTeam = spinner.selectedItem as String + messageClickableView.performClick() Braze.getInstance(ctx).getCurrentUser { brazeUser -> brazeUser?.setCustomUserAttribute("FavoriteTeam", selectedTeam) } - messageClickableView.performClick() } ``` {% endtab %} @@ -346,10 +346,10 @@ Using the view subclass, after a user presses submit, pass the attribute with it ```java @Override public void onClick(View v) { + String selectedTeam = (String) spinner.getSelectedItem(); + messageClickableView.performClick(); Braze.getInstance(ctx).getCurrentUser(brazeUser -> { - String selectedTeam = (String) spinner.getSelectedItem(); brazeUser.setCustomUserAttribute("FavoriteTeam", selectedTeam); - messageClickableView.performClick(); }); } ``` From fb2ce91fb57bf1035f8bf384002cdbea803fe292 Mon Sep 17 00:00:00 2001 From: internetisaiah <95643215+internetisaiah@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:43:19 -0800 Subject: [PATCH 5/5] triger build