Skip to content

Commit

Permalink
Version 11.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lowip committed Jan 17, 2025
1 parent fc575be commit 89347f6
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 39 deletions.
6 changes: 3 additions & 3 deletions BrazeKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'BrazeKit'
s.version = '11.4.0'
s.version = '11.5.0'
s.summary = 'Braze Main SDK library providing support for analytics and push notifications.'

s.homepage = 'https://braze.com'
Expand All @@ -9,8 +9,8 @@ Pod::Spec.new do |s|
s.authors = 'Braze, Inc.'

s.source = {
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/BrazeKit.zip',
:sha256 => '809ce3973f8ebfc65ddf5b7aac8785fb9b1507c2e15e1e64dea9b3f583bb5fa7'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/BrazeKit.zip',
:sha256 => '6a1e4493f47a70147a4cf9d88aa47a85914b2ce0b85c4d27fd51c1b010c59604'
}

s.swift_version = '5.0'
Expand Down
8 changes: 4 additions & 4 deletions BrazeKitCompat.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = 'BrazeKitCompat'
s.version = '11.4.0'
s.version = '11.5.0'
s.summary = 'Compatibility library for users migrating from AppboyKit.'

s.homepage = 'https://braze.com'
s.documentation_url = 'https://braze-inc.github.io/braze-swift-sdk/documentation/brazekitcompat/'
s.license = { :type => 'Commercial' }
s.authors = 'Braze, Inc.'

s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '11.4.0' }
s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '11.5.0' }

s.swift_version = '5.0'
s.ios.deployment_target = '12.0'
Expand All @@ -18,8 +18,8 @@ Pod::Spec.new do |s|
s.public_header_files = 'Sources/BrazeKitCompat/include/*.h'
s.static_framework = true

s.dependency 'BrazeKit', '11.4.0'
s.dependency 'BrazeLocation', '11.4.0'
s.dependency 'BrazeKit', '11.5.0'
s.dependency 'BrazeLocation', '11.5.0'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end
8 changes: 4 additions & 4 deletions BrazeLocation.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'BrazeLocation'
s.version = '11.4.0'
s.version = '11.5.0'
s.summary = 'Braze location library providing support for location analytics and geofence monitoring.'

s.homepage = 'https://braze.com'
Expand All @@ -9,8 +9,8 @@ Pod::Spec.new do |s|
s.authors = 'Braze, Inc.'

s.source = {
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/BrazeLocation.zip',
:sha256 => 'f957e6fb75ded976f7de565b4be0420d3c2912d4261f436e87ce353fc0b6b752'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/BrazeLocation.zip',
:sha256 => 'b2aec021475e9c92979d1b77670d93b21b35898c8a5b6d65bf22586222340f40'
}

s.swift_version = '5.0'
Expand All @@ -21,7 +21,7 @@ Pod::Spec.new do |s|
s.vendored_framework = 'BrazeLocation.xcframework'
s.resource_bundles = { 'BrazeLocation' => ['Sources/BrazeLocationResources/Resources/**/*'] }

s.dependency 'BrazeKit', '11.4.0'
s.dependency 'BrazeKit', '11.5.0'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end
6 changes: 3 additions & 3 deletions BrazeNotificationService.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'BrazeNotificationService'
s.version = '11.4.0'
s.version = '11.5.0'
s.summary = 'Braze notification service extension library providing support for Rich Push notifications.'

s.homepage = 'https://braze.com'
Expand All @@ -9,8 +9,8 @@ Pod::Spec.new do |s|
s.authors = 'Braze, Inc.'

s.source = {
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/BrazeNotificationService.zip',
:sha256 => '6804bfaf9c5efe55c109a6d63be264f9abc83acd8484718f9ddaef344f1371bf'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/BrazeNotificationService.zip',
:sha256 => '9008d433f56940a44709e40d42d0d74e710a60151e022e00108df38a7e8895f4'
}

s.swift_version = '5.0'
Expand Down
6 changes: 3 additions & 3 deletions BrazePushStory.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'BrazePushStory'
s.version = '11.4.0'
s.version = '11.5.0'
s.summary = 'Braze notification content extension library providing support for Push Stories.'

s.homepage = 'https://braze.com'
Expand All @@ -9,8 +9,8 @@ Pod::Spec.new do |s|
s.authors = 'Braze, Inc.'

s.source = {
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/BrazePushStory.zip',
:sha256 => '2e945d6f17812202a951a8598071c278acf6d2a9962e49abb27a8134a28e7ae0'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/BrazePushStory.zip',
:sha256 => 'd6eda8573576d887b3430a3e2d89293d2f0e94e4ac5ca118141559d54a0a1d6c'
}

s.swift_version = '5.0'
Expand Down
6 changes: 3 additions & 3 deletions BrazeUI.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = 'BrazeUI'
s.version = '11.4.0'
s.version = '11.5.0'
s.summary = 'Braze-provided user interface library for In-App Messages and Content Cards.'

s.homepage = 'https://braze.com'
s.documentation_url = 'https://braze-inc.github.io/braze-swift-sdk/documentation/brazeui/'
s.license = { :type => 'Commercial' }
s.authors = 'Braze, Inc.'

s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '11.4.0' }
s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '11.5.0' }

s.swift_version = '5.0'
s.ios.deployment_target = '12.0'
Expand All @@ -18,7 +18,7 @@ Pod::Spec.new do |s|
s.resource_bundles = { 'BrazeUI' => ['Sources/BrazeUI/Resources/**/*'] }
s.static_framework = true

s.dependency 'BrazeKit', '11.4.0'
s.dependency 'BrazeKit', '11.5.0'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end
6 changes: 3 additions & 3 deletions BrazeUICompat.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = 'BrazeUICompat'
s.version = '11.4.0'
s.version = '11.5.0'
s.summary = 'Compatibility UI library for users migrating from AppboyUI.'

s.homepage = 'https://braze.com'
s.documentation_url = 'https://braze-inc.github.io/braze-swift-sdk/documentation/brazeui/'
s.license = { :type => 'Commercial' }
s.authors = 'Braze, Inc.'

s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '11.4.0' }
s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '11.5.0' }

s.swift_version = '5.0'
s.ios.deployment_target = '12.0'
Expand All @@ -18,7 +18,7 @@ Pod::Spec.new do |s|
s.resource_bundles = { 'BrazeUICompat' => 'Sources/BrazeUICompat/*/Resources/**/*.*' }
s.static_framework = true

s.dependency 'BrazeKitCompat', '11.4.0'
s.dependency 'BrazeKitCompat', '11.5.0'
s.dependency 'SDWebImage', '>= 5.19.7', '< 6'

s.user_target_xcconfig = { 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES' }
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 11.5.0

##### Fixed
- `Braze.banners.getBanner(for:_:)` now successfully returns a cached `Banner` object for the requested placement ID as long as a Banner Cards sync has ever succeeded for the current user.
- Previously, it would log a warning and pass `nil` to the completion handler if a Banner Cards sync had not been completed for the current user during the current session specifically.
- This change aligns behavior with the Android SDK.
- Fixes an issue where images with the `"JPEG"` image type would sometimes not display in Push Stories.
- Fixes an issue where an in-app message in a Braze-provided UI can be displayed for an ineligible user under rare conditions.
- This may occur if the in-app message was in the process of being displayed in the UI at the same time that the user was changed to a different user.

##### Added
- Adds [`Braze.User.id`](https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/user/id) to access the current user identifier synchronously.
- Deprecates `Braze.User.id() async` and `Braze.User.id(queue:completion:)` in favor of `Braze.User.id`.
- These methods will be removed fully in a future update.
- Adds the optional parameter `userIDMatchBehavior` to the initializers of `Braze.InAppMessageRaw.Context`. This determines the behavior in the UI when the current identified user is different from the one that triggered the in-app message.
- The default for Braze-provided UIs (`.enforce`) will enforce that the user ID matches the user ID that triggered the in-app message. If there is a mismatch, the in-app message will not be displayed.
- For custom UIs, the default is `.ignore` and a mismatch will still display the in-app message.

## 11.4.0

##### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Examples/ObjC/manual-integration-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ ! -f "manual-integration-setup.sh" ]; then
fi

# Constants
url="https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/braze-swift-sdk-prebuilt.zip"
url="https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/braze-swift-sdk-prebuilt.zip"

echo "" "Cleaning up"
rm -rf braze-swift-sdk-prebuilt
Expand Down
2 changes: 1 addition & 1 deletion Examples/Swift/manual-integration-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ ! -f "manual-integration-setup.sh" ]; then
fi

# Constants
url="https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/braze-swift-sdk-prebuilt.zip"
url="https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/braze-swift-sdk-prebuilt.zip"

echo "" "Cleaning up"
rm -rf braze-swift-sdk-prebuilt
Expand Down
16 changes: 8 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ let package = Package(
targets: [
.binaryTarget(
name: "BrazeKit",
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/BrazeKit.zip",
checksum: "809ce3973f8ebfc65ddf5b7aac8785fb9b1507c2e15e1e64dea9b3f583bb5fa7"
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/BrazeKit.zip",
checksum: "6a1e4493f47a70147a4cf9d88aa47a85914b2ce0b85c4d27fd51c1b010c59604"
),
.target(
name: "BrazeKitResources",
Expand All @@ -67,8 +67,8 @@ let package = Package(
),
.binaryTarget(
name: "BrazeLocation",
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/BrazeLocation.zip",
checksum: "f957e6fb75ded976f7de565b4be0420d3c2912d4261f436e87ce353fc0b6b752"
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/BrazeLocation.zip",
checksum: "b2aec021475e9c92979d1b77670d93b21b35898c8a5b6d65bf22586222340f40"
),
.target(
name: "BrazeLocationResources",
Expand All @@ -78,13 +78,13 @@ let package = Package(
),
.binaryTarget(
name: "BrazeNotificationService",
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/BrazeNotificationService.zip",
checksum: "6804bfaf9c5efe55c109a6d63be264f9abc83acd8484718f9ddaef344f1371bf"
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/BrazeNotificationService.zip",
checksum: "9008d433f56940a44709e40d42d0d74e710a60151e022e00108df38a7e8895f4"
),
.binaryTarget(
name: "BrazePushStory",
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/11.4.0/BrazePushStory.zip",
checksum: "2e945d6f17812202a951a8598071c278acf6d2a9962e49abb27a8134a28e7ae0"
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/11.5.0/BrazePushStory.zip",
checksum: "d6eda8573576d887b3430a3e2d89293d2f0e94e4ac5ca118141559d54a0a1d6c"
),
.target(
name: "BrazePushStoryResources",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<p align="center">
<a href="https://github.com/braze-inc/braze-swift-sdk/releases">
<img src="https://badgen.net/badge/version/11.4.0/blue" alt="Version: 11.4.0">
<img src="https://badgen.net/badge/version/11.5.0/blue" alt="Version: 11.5.0">
</a>
<a href="#">
<img src="https://badgen.net/badge/platforms/iOS%20%7C%20visionOS%20%7C%20tvOS%20%7C%20Mac%20Catalyst/orange"
Expand Down
9 changes: 4 additions & 5 deletions Sources/BrazeUI/Dependencies/GIFViewProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@ public struct GIFViewProvider: Sendable {
#endif

/// Creates a view able to display static and animated GIF images.
/// - Parameters:
/// - url: The local file url for the image.
///
/// This closure takes in the local file url for the image and returns the corresponding `UIView`.
public var view: @MainActor @Sendable (_ url: URL?) -> UIView

/// Updates the passed view with a new image at `url`.
/// - Parameters:
/// - view: The view to update.
/// - url: The local file url for the image.
///
/// This closure takes in the view to update and the local file url for the image as parameters.
public var updateView: @MainActor @Sendable (_ view: UIView, _ url: URL?) -> Void

/// Creates a GIF view provider.
Expand Down
16 changes: 16 additions & 0 deletions Sources/BrazeUI/InAppMessageUI/InAppMessageUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,22 @@ open class BrazeInAppMessageUI:
return
}

// Verifies that the user that triggered the message matches the current identified user on the
// braze instance. The ID-matching behavior is enforced by default for in-app messages originating
// from Braze and ignored by default for local in-app messages.
if case .enforce(let messageUserId) = message.context?.userIDMatchBehavior,
let braze = message.context?.braze as? Braze,
messageUserId != braze.user.id
{
let error = Error.triggeredUserCurrentUserMismatch(
messageId: message.data.id,
currentUser: braze.user.id,
previousUser: messageUserId
)
message.context?.logError(flattened: error.logDescription)
return
}

// - View controller
let viewController = ViewController(
ui: self,
Expand Down
10 changes: 10 additions & 0 deletions Sources/BrazeUI/InAppMessageUI/InAppMessageUIError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ extension BrazeInAppMessageUI {
case noWindowScene
case assetsFailure(Braze.ErrorString)
case invalidConstraints
case triggeredUserCurrentUserMismatch(
messageId: String?, currentUser: String?, previousUser: String?)

case otherMessagePresented(push: Bool)
case messageContextInvalid
Expand Down Expand Up @@ -82,6 +84,14 @@ extension BrazeInAppMessageUI.Error {
case .invalidConstraints:
return
"Unable to present message - constraints were invalid or nil."
case .triggeredUserCurrentUserMismatch(let messageId, let currentUser, let previousUser):
return
"""
Skipping message presentation - the current user is not the user who triggered the message.
- in-app message: \(messageId ?? "No message ID")
- current user: \(currentUser ?? "anonymous user")
- original user: \(previousUser ?? "anonymous user")
"""

case .otherMessagePresented(let push):
return
Expand Down

0 comments on commit 89347f6

Please sign in to comment.