17.0.0
Breaking
Braze.initandchangeUser(userId:)no longer block the calling thread.- The following properties now block the calling thread until the SDK has settled, ensuring they reflect the latest user state immediately after
changeUserorBraze.init:braze.user.idbraze.deviceIdbraze.contentCards.cardsbraze.contentCards.unviewedCardsbraze.contentCards.lastUpdatebraze.featureFlags.featureFlagsbraze.featureFlags.featureFlag(id:)- For UI and other latency-sensitive code paths, prefer the asynchronous getters (
getCachedContentCards(_:),getUnviewedCards(_:),getLastUpdate(_:),getAllFeatureFlags(_:)).
braze.user.idnow returnsnilafter callingwipeData().- Previously,
braze.user.idcontinued to return the last user ID afterwipeData(). - This matches the Swift SDK's behavior with that of the Android SDK.
- Previously,
changeUsernow notifiesBraze.ContentCards.subscribeToUpdates(_:)subscribers after a user switch, matching the existing Android SDK behavior.- Previously, subscribers were not notified until the next Content Cards sync.
- Removes the deprecated push-to-start token update API on
Braze.LiveActivities.- Removes the deprecated
Braze.LiveActivities.PushToStartTokenUpdateenum and thepushToStartTokenUpdatesStreamproperty. - Use
subscribeToStateUpdates(_:)instead, which delivers the push-to-start token lifecycle events (UpdateEvent.ActivityType.pushToStartTokenRead,.pushToStartTokenFlushed,.pushToStartOptedOut,.pushToStartOptOutFlushed) as part of the complete Live Activities lifecycle in a single subscription.
- Removes the deprecated
Added
- Adds non-blocking asynchronous accessors for user and device identifiers:
Braze.User.getId(_:)andBraze.User.getId() async— deliver on the main thread.Braze.getDeviceId(_:)andBraze.getDeviceId() async— deliver on the main thread.- ObjC bridges:
getIdWithCompletion:andgetDeviceIdWithCompletion:. - Prefer these over the synchronous properties on the main thread or in
@MainActorcontexts.
- Adds an
sdkDisablederror onBraze.ContentCards.requestRefresh(_:),Braze.FeatureFlags.requestRefresh(_:), andBraze.Banners.requestBannersRefresh(_:). When the SDK is disabled, these now invoke their completion handler with.sdkDisabledinstead of leaving it uncalled.