From 3d76957d424764001dab791122010d26d4bd3b83 Mon Sep 17 00:00:00 2001 From: Jeriel Ng Date: Tue, 6 Dec 2022 14:40:30 -0500 Subject: [PATCH] Version 5.7.0 --- BrazeKit.podspec | 6 +-- BrazeLocation.podspec | 8 ++-- BrazeNotificationService.podspec | 6 +-- BrazePushStory.podspec | 6 +-- BrazeUI.podspec | 6 +-- CHANGELOG.md | 18 ++++++++- Examples/ObjC/Sources/ContentCards/Info.plist | 26 ------------ .../ObjC/Sources/InAppMessages/Info.plist | 26 ------------ .../Swift/Sources/ContentCards/Info.plist | 26 ------------ .../Swift/Sources/InAppMessages/Info.plist | 26 ------------ Package.swift | 16 ++++---- README.md | 2 +- .../BrazeUI/Dependencies/ViewDimension.swift | 38 ++++++++++++++++++ .../Views/InAppMessageUIFullImageView.swift | 8 ++-- .../Views/InAppMessageUIFullView.swift | 8 ++-- .../Views/InAppMessageUIModalImageView.swift | 40 +++++++++++++------ .../Views/InAppMessageUIModalView.swift | 21 +++++----- .../Views/Misc/ButtonView.swift | 2 + Sources/BrazeUI/PreviewProviders.swift | 17 ++++++-- 19 files changed, 142 insertions(+), 164 deletions(-) delete mode 100644 Examples/ObjC/Sources/ContentCards/Info.plist delete mode 100644 Examples/ObjC/Sources/InAppMessages/Info.plist delete mode 100644 Examples/Swift/Sources/ContentCards/Info.plist delete mode 100644 Examples/Swift/Sources/InAppMessages/Info.plist create mode 100644 Sources/BrazeUI/Dependencies/ViewDimension.swift diff --git a/BrazeKit.podspec b/BrazeKit.podspec index 51a23e9568..e0bbcf2749 100644 --- a/BrazeKit.podspec +++ b/BrazeKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazeKit' - s.version = '5.6.4' + s.version = '5.7.0' s.summary = 'Braze Main SDK library providing support for analytics and push notifications.' s.homepage = 'https://braze.com' @@ -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/5.6.4/BrazeKit-CocoaPods.zip', - :sha256 => '8029a5a48f7d91efb6d8150582c92445566ce1ba2c7e6048d13e64af53cc8f0a' + :http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazeKit-CocoaPods.zip', + :sha256 => 'dcef97f42830884252cecc2a46d863e7ed231e7b3d8cc734d35e849c57628415' } s.swift_version = '5.0' diff --git a/BrazeLocation.podspec b/BrazeLocation.podspec index 3d1a4039d2..8743405de4 100644 --- a/BrazeLocation.podspec +++ b/BrazeLocation.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazeLocation' - s.version = '5.6.4' + s.version = '5.7.0' s.summary = 'Braze location library providing support for location analytics and geofence monitoring.' s.homepage = 'https://braze.com' @@ -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/5.6.4/BrazeLocation-CocoaPods.zip', - :sha256 => 'f5fddf0bf389053d8e9e8eabe4600db2ef5ef8396e7b11430a65fac377d1522b' + :http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazeLocation-CocoaPods.zip', + :sha256 => '66372a30285e585189d20f20da3d602dd50f9541daee7bffd0b2729e28a19996' } s.swift_version = '5.0' @@ -21,5 +21,5 @@ Pod::Spec.new do |s| # Depends on BrazeKit because BrazeKit includes the internal _BrazeLocationClient symbols required # for linking against BrazeLocation. - s.dependency 'BrazeKit', '5.6.4' + s.dependency 'BrazeKit', '5.7.0' end diff --git a/BrazeNotificationService.podspec b/BrazeNotificationService.podspec index f1a6425341..b1d7834712 100644 --- a/BrazeNotificationService.podspec +++ b/BrazeNotificationService.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazeNotificationService' - s.version = '5.6.4' + s.version = '5.7.0' s.summary = 'Braze notification service extension library providing support for Rich Push notifications.' s.homepage = 'https://braze.com' @@ -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/5.6.4/BrazeNotificationService-CocoaPods.zip', - :sha256 => '0e5c6ecc1f19db1cb12ea1a7749ebc1265434178695121509c326ec14c87c102' + :http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazeNotificationService-CocoaPods.zip', + :sha256 => '335ce992d5a53b0efc79097ea77ccf092ff92013d9a7e58d02ef7f86763b8c70' } s.swift_version = '5.0' diff --git a/BrazePushStory.podspec b/BrazePushStory.podspec index 2e377b6666..39fe054fa3 100644 --- a/BrazePushStory.podspec +++ b/BrazePushStory.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazePushStory' - s.version = '5.6.4' + s.version = '5.7.0' s.summary = 'Braze notification content extension library providing support for Push Stories.' s.homepage = 'https://braze.com' @@ -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/5.6.4/BrazePushStory-CocoaPods.zip', - :sha256 => 'f21f0c9655bb143790ac55e8ba105167b8ab7a5ef55df68992c0e61a91a24ecf' + :http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazePushStory-CocoaPods.zip', + :sha256 => '741f055974e9e4fb70810ba716fe2177ad486bd7b7d32779a65087a6055bb597' } s.swift_version = '5.0' diff --git a/BrazeUI.podspec b/BrazeUI.podspec index 4ed4d324b8..6a3835c699 100644 --- a/BrazeUI.podspec +++ b/BrazeUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazeUI' - s.version = '5.6.4' + s.version = '5.7.0' s.summary = 'Braze-provided user interface library for In-App Messages.' s.homepage = 'https://braze.com' @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.license = { :type => 'Commercial' } s.authors = 'Braze, Inc.' - s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '5.6.4' } + s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '5.7.0' } s.swift_version = '5.0' s.ios.deployment_target = '10.0' @@ -17,5 +17,5 @@ Pod::Spec.new do |s| s.source_files = 'Sources/BrazeUI/**/*.swift' s.resource_bundles = { 'BrazeUI' => 'Sources/BrazeUI/Resources/**/*' } - s.dependency 'BrazeKit', '5.6.4' + s.dependency 'BrazeKit', '5.7.0' end diff --git a/CHANGELOG.md b/CHANGELOG.md index abbe7b342f..b32a292dc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## 5.7.0 + +##### Fixed +- Fixes an issue where modal image in-app messages would not respect the aspect ratio of the image when the height of the image is larger than its width. + +##### Changed +- Changes modal, modal image, full, and full image in-app message view attributes to use the `ViewDimension` type for their `minWidth`, `maxWidth` and `maxHeight` attributes. + - The `ViewDimension` type enables providing different values for regular and large size-classes. + +##### Added +- Adds a configuration to use a randomly generated UUID instead of IDFV as the device ID: [`useUUIDAsDeviceId`](https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/configuration-swift.class/useuuidasdeviceid). + - This configuration defaults to `false`. To opt in to this feature, set this value to `true`. + - Enabling this value will only affect new devices. Existing devices will use the device identifier that was previously registered. + ## 5.6.4 ##### Fixed @@ -17,8 +31,8 @@ [`Braze.User.id()`]: https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/user-swift.class/id() [`Braze.deviceId()`]: https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/deviceid() [`ContentCards.requestRefresh()`]: https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/contentcards-swift.class/requestrefresh() -[`ContentCards.cardsStream`]: https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/contentcards-swift.class/cardsStream -[`ContentCards.subscribeToUpdates(_:)`]: https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/contentcards-swift.class/subscribetoupdates(_:) +[`ContentCards.cardsStream`]: https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/contentcards-swift.class/cardsstream +[`ContentCards.subscribeToUpdates(_:)`]: https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/contentcards-swift.class/subscribetoupdates(_:) ## 5.6.3 diff --git a/Examples/ObjC/Sources/ContentCards/Info.plist b/Examples/ObjC/Sources/ContentCards/Info.plist deleted file mode 100644 index 0c015f1468..0000000000 --- a/Examples/ObjC/Sources/ContentCards/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - ContentCards - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - UILaunchStoryboardName - LaunchScreen - - diff --git a/Examples/ObjC/Sources/InAppMessages/Info.plist b/Examples/ObjC/Sources/InAppMessages/Info.plist deleted file mode 100644 index 4f97542122..0000000000 --- a/Examples/ObjC/Sources/InAppMessages/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - InAppMessages - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - UILaunchStoryboardName - LaunchScreen - - diff --git a/Examples/Swift/Sources/ContentCards/Info.plist b/Examples/Swift/Sources/ContentCards/Info.plist deleted file mode 100644 index 0c015f1468..0000000000 --- a/Examples/Swift/Sources/ContentCards/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - ContentCards - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - UILaunchStoryboardName - LaunchScreen - - diff --git a/Examples/Swift/Sources/InAppMessages/Info.plist b/Examples/Swift/Sources/InAppMessages/Info.plist deleted file mode 100644 index 4f97542122..0000000000 --- a/Examples/Swift/Sources/InAppMessages/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - InAppMessages - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - UILaunchStoryboardName - LaunchScreen - - diff --git a/Package.swift b/Package.swift index dccf5c0793..9fe8e83902 100644 --- a/Package.swift +++ b/Package.swift @@ -26,8 +26,8 @@ let package = Package( targets: [ .binaryTarget( name: "BrazeKit", - url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazeKit.zip", - checksum: "cc6375e451a181804528945a811a850444ae2d892f140491910237648bbe19ed" + url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazeKit.zip", + checksum: "bc13bbaeceafc76e56800a7e9dfdc0886012855f073a1dfb1c42f1e7c7def1c7" ), .target( name: "BrazeKitResources", @@ -42,18 +42,18 @@ let package = Package( ), .binaryTarget( name: "BrazeLocation", - url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazeLocation.zip", - checksum: "33a0900c0ca9a9e5b94b86b111595e83e80b3723be7c0e7cc9e99bb03eb7c2b4" + url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazeLocation.zip", + checksum: "7edcc43e75f42de619aacfc2c7ec4cc03c3764236bd28806bb1c8da15b415818" ), .binaryTarget( name: "BrazeNotificationService", - url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazeNotificationService.zip", - checksum: "32130b8da6bc00ce43ae2e495fd873cc1ec458b5c305d4bd9451cfe0d894a7f9" + url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazeNotificationService.zip", + checksum: "458cd5f89654daa37ff627975b9e251cbc28d9d66dc0d1fafc234145e81b6f1f" ), .binaryTarget( name: "BrazePushStory", - url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazePushStory.zip", - checksum: "5b83874ae6eacf545c70e120655827976930da707e66297eba2f161bf5c1c089" + url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazePushStory.zip", + checksum: "3d7ce4e389ffc310e33e485cf6f11171e5dc91229d4d5be89f9546cc41d39ed6" ), ] ) diff --git a/README.md b/README.md index af1f1f34d9..e3f0e79bd1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

- Version: 5.6.4 + Version: 5.7.0 Void = { _ in } ) -> some View { - final class Wrapper: UIViewRepresentable { + + class PreviewCoordinator { + var setup = false + } + + struct Wrapper: UIViewRepresentable { + let view: UIView let pin: UILayoutPriority? let center: UILayoutPriority? let flex: Bool let layout: (UIView) -> Void - var setup = false init( view: UIView, @@ -42,8 +47,8 @@ } func updateUIView(_ view: UIView, context: Context) { - guard !setup else { return } - setup = true + guard !context.coordinator.setup else { return } + context.coordinator.setup = true if let pin = pin { view.anchors.edges.pin().forEach { $0.priority = pin } } @@ -60,6 +65,10 @@ func makeUIView(context: Context) -> UIView { return view } + + func makeCoordinator() -> PreviewCoordinator { + .init() + } } return Wrapper(view: self, pin: pin, center: center, flex: flex, layout: layout)