2.0.0 - Flutter

Breaking changes

  • widgetId must now be a stable label per widget placement, such as homepage-stories: native 2.0 aggregates widget analytics by it. Use a label that is distinct per placement and the same across app sessions; apps that generate an ID per mount should switch to fixed labels. Do not give two widgets that are mounted at the same time the same widgetId.
  • BlazeFollowEntity.entityType is now required and nullable, so an entity without it no longer compiles. Pass entityType: null where the category is unknown.
  • BlazeSDK.setExternalUserId(externalUserId) now takes a non-null String. A blank ID fails with the reason invalidExternalUserId and leaves the current user unchanged. To log out, call BlazeSDK.logout(); in 1.x this was done by passing null.
  • BlazeAnalyticsEvent in onEventTriggered follows the unified events schema of native 2.0: every enumerated value is lowercase snake_case, and events and fields are renamed, retyped, or removed, so code that uses a removed enum member or field no longer compiles. BlazeAnalyticsEvent.tech is a new required field, and every enum has an unknown member, so an exhaustive switch needs an unknown case. See Migrate to the unified events schema.
  • customActionButtons on the Moments and Stories player button styles takes at most two buttons, each with a unique customParams.id. A list that breaks the rule now throws an ArgumentError before anything reaches native; in 1.x it crashed the app. An empty list now removes the buttons; in 1.x it was ignored.
  • iconPositioning on BlazeMomentsPlayerCtaIconStyle and BlazeVideosPlayerCtaIconStyle is now required, so a CTA icon style without it no longer compiles. Set it to start. It applies on Android only.

Added

  • BlazeAnalyticsEvent describes the full native 2.0 event, including the tech, tab, and search blocks and the new event actions, triggers, and fields.
  • An analytics event this SDK version cannot decode is now reported through BlazeGlobalDelegate.onErrorThrown with domain general and reason failedToParseAnalyticsEvent. In 1.x such an event was dropped with a debug log only.
  • BlazeSDK.logout() to log out the current user, and restoreExternalUserId in BlazeSDK.initSDK to decide whether init restores the previous session's user. See Getting started Flutter.
  • BlazeError.reason values invalidExternalUserId and failedToLogout, on both platforms.
  • iOS: a blank widgetId is reported through onErrorThrown with the reason missingWidgetIdentifier.

Changed

  • The external user ID now persists across launches, and initSDK without externalUserId restores the previous user. Pass restoreExternalUserId: false to start every launch anonymous, or call BlazeSDK.logout().
  • Analytics volume changes with native 2.0: for example, start and exit events strictly alternate, sdk_init is reported under event_category: 'global', and widget_load and tab_data_load fire once per id per session. Reset baselines that compare across the upgrade. See Reporting changes to expect.
  • On Android, BlazeError.domain and BlazeError.reason are now the native declared values, such as initialization and applicationNotInitialised, instead of the Kotlin constant names. On iOS, the errors that carry a reason (invalidExternalUserId, failedToSetExternalUserId, failedToLogout, applicationNotInitialised, missingWidgetIdentifier) now use the same domain strings as Android (userManagement, initialization, widget). Update code that compares them.
  • A player style passed per call, per widget, or in the Moments tabs configuration is now applied on top of defaultStoryPlayerStyle, defaultMomentsPlayerStyle, or defaultVideosPlayerStyle from initSDK, so fields it omits keep the app's default instead of the native preset.
  • Moments and Stories playback configurations now start from the app's current default, as Videos already did, so a field they omit keeps the default and a partial setDefaultStoriesPlaybackConfiguration or setDefaultMomentsPlaybackConfiguration call updates the default instead of replacing it.
  • Android widgets: letterSpacing in widget text styles is now in points, as on iOS. Convert an em value to points (em × text size).
  • Each mounted widget now has its own platform channel, so the events and controller calls of two mounted widgets no longer mix.

Fixed

  • Android: a CTA icon with iconImage on the Moments and Videos players now shows, with its iconTint.
  • Android: a per-call or per-widget enterPipOnAppBackground no longer rewrites the default Videos playback configuration.
  • Android: a widget text style that omits the font, or a status-indicator or badge style that omits the background image, now keeps the existing one. Before, a partial style or a perItemStyleOverrides entry cleared it.
  • Android: Fixed animated thumbnails showing square edges instead of the item's rounded shape when the image border has a margin, for example in StoriesWidget.Row.animatedThumbnailsCircles.

Native SDK updates

  • iOS BlazeSDK 2.0.0, Android BlazeSDK 2.0.2.