Breaking
BannerViewis no longer aWebView. It hosts one.WebViewmethods called onBannerViewno longer compile.placementId,heightCallback,onDismissCallback, anddestroy()are unchanged.- Jetpack Compose
ContentCardsListbehavior changed whencardsisn't provided:cardUpdateHandleris now also called when the list resumes, when cached cards load at session start, and after a card is dismissed. Make sure your handler is safe to call repeatedly with the same cards.- Cards are shown once the host lifecycle reaches
RESUMED, instead of on first composition.
com.braze:android-sdk-jetpack-composeno longer depends onandroidx.compose.material:material(Material 2) and now depends onandroidx.compose.material3:material3. If your app importsandroidx.compose.materialand relied on the SDK to provide it, addandroidx.compose.material:materialto your own dependencies.
Fixed
- Fixed an issue where
BrazeWebViewActivityshowed a blank screen while web content loaded. An indeterminate spinner is now shown until the page finishes loading or the main frame fails. Host apps that override thecom_braze_webview_activitylayout should include aProgressBarwith idcom_braze_webview_activity_progress_barto keep the spinner. Subclasses can show and hide that spinner withonMainFrameLoadStarted,onMainFrameLoadEnded, andhideWebViewLoadingIndicator. See #117. - Fixed
BrazeLogger.e()so it is written at Android log priority ERROR instead of DEBUG, and error logs with no exception so they are written at ERROR instead of WARN. - Fixed a host-app crash on Android 16 when creating
BannerView, including inside a Jetpack ComposeAndroidView. System WebView provider setup can throwAndroidRuntimeException(Resources$NotFoundException: failed to redirect ResourcesImpl).BannerViewnow catches that failure, logs it, and shows nothing. - Fixed an issue where a large backlog of custom events could exhaust memory. Events queued by earlier SDK versions are kept on upgrade and are sent.
- Fixed an issue where custom events logged in quick succession could be dropped before being saved to disk, causing them to never be sent.
- Fixed
getDeviceIdAsync()never invoking its callback when SDK startup blocked the serial work queue, including background cold starts. The device ID is read off that queue, and eitheronSuccessoronErroris invoked. See #115. - Fixed an issue where a banner the user dismissed could reappear when a banner refresh finished at the same time.
- Fixed
DisplayNextInAppMessage()not working for Unity integrations that use the Prime31-compatibleBrazeUnityPlayerActivity. - Fixed a crash in
BrazeInAppMessageManageron devices that don't provide theandroid.R.integer.config_shortAnimTimesystem resource, seen on some Honor devices.DefaultInAppMessageAnimationFactorynow falls back to a 200ms animation duration. - Fixed Jetpack Compose
ContentCardsListlogging a leading control card's impression on every card update. It's now logged once per list, so reported control impressions may decrease.
Added
- Added Kotlin
Flowversions of the event subscriptions:IBraze.contentCardsEventsFlow(),IBraze.featureFlagsEventsFlow(),IBraze.bannersEventsFlow(), andIBraze.changeUserEventsFlow(). Each Flow subscribes when collection starts, unsubscribes when collection is cancelled, and buffers events so none are dropped. Each Flow emits the same events, in the same order, as the matchingsubscribeTo*Eventsmethod.- To migrate from the deprecated
subscribeToContentCardsUpdates,subscribeToFeatureFlagsUpdates,subscribeToBannersUpdates, andsubscribeToBannersErrors, collect the matching Flow. Each Flow emitsContentCardsEvent,FeatureFlagsEvent, orBannersEventinstead of the old*UpdatedEvent. Data events carry acacheSnapshot, andBannersEvent.ErrorEventreplacessubscribeToBannersErrors.
- To migrate from the deprecated
Changed
- Jetpack Compose
ContentCardsListnow hides the pull-to-refresh indicator as soon as a sync fails, instead of after a 5-second timeout. - Migrated Jetpack Compose
ContentCardsListfrom Material 2 (androidx.compose.material) to Material 3 (androidx.compose.material3). The pull-to-refresh indicator, swipe-to-dismiss, divider, and text now use Material 3.- The pull-to-refresh indicator now follows your Material 3
MaterialTheme. Apps with only a Material 2 theme, or no theme, get the Material 3 default light colors. - Text whose
TextStylehas no color now takes its color from the Material 3 content color instead of the Material 2 one. - Swipe-to-dismiss still dismisses at 50% of the card width. Material 3 can also dismiss a card on a fast fling that stops before that point.
- The pull-to-refresh indicator now follows your Material 3