Skip to content

Commit

Permalink
Version 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jerielng committed Oct 3, 2023
1 parent 47b2755 commit f36aac0
Show file tree
Hide file tree
Showing 30 changed files with 400 additions and 212 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 = '6.6.1'
s.version = '7.0.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/6.6.1/BrazeKit.zip',
:sha256 => 'a8047d27fcbeb96cd19241e822241e97af36d1bff7afcc62f8bc5264a9fb8432'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/7.0.0/BrazeKit.zip',
:sha256 => 'ae890a450e889ad57399b36835af98699defc02da2fff9bd1756b8963d545eb5'
}

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 = '6.6.1'
s.version = '7.0.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 => '6.6.1' }
s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '7.0.0' }

s.swift_version = '5.0'
s.ios.deployment_target = '11.0'
Expand All @@ -18,8 +18,8 @@ Pod::Spec.new do |s|
s.source_files = 'Sources/BrazeKitCompat/**/*.{h,m}'
s.public_header_files = 'Sources/BrazeKitCompat/include/*.h'

s.dependency 'BrazeKit', '6.6.1'
s.dependency 'BrazeLocation', '6.6.1'
s.dependency 'BrazeKit', '7.0.0'
s.dependency 'BrazeLocation', '7.0.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 = '6.6.1'
s.version = '7.0.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/6.6.1/BrazeLocation.zip',
:sha256 => 'b89f1fc5287e90ea9e936c2f83bf2afa6622d2c2c883f32a7cfea6d78d9700e7'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/7.0.0/BrazeLocation.zip',
:sha256 => 'eb32a3834e0dc09df3c069647b6ac1e1fbce5cb1fed49050325277e12c7773cd'
}

s.swift_version = '5.0'
Expand All @@ -21,7 +21,7 @@ Pod::Spec.new do |s|

# Depends on BrazeKit because BrazeKit includes the internal _BrazeLocationClient symbols required
# for linking against BrazeLocation.
s.dependency 'BrazeKit', '6.6.1'
s.dependency 'BrazeKit', '7.0.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 = '6.6.1'
s.version = '7.0.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/6.6.1/BrazeNotificationService.zip',
:sha256 => 'd375317a93be6b4fcd6b56089ec095d9df33e6e8b3ed965db054eaa0eddf4a09'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/7.0.0/BrazeNotificationService.zip',
:sha256 => 'ebf1ca2501212501853662a3853b498063a3f2b46ae2de072262666c4f731e24'
}

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 = '6.6.1'
s.version = '7.0.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/6.6.1/BrazePushStory.zip',
:sha256 => 'ee51329c13f235e89fb023baaf1c20a583f0b66c21c1928b52f3e8b9ba7a3497'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/7.0.0/BrazePushStory.zip',
:sha256 => '26e3ff1284d14a2d2c7c9d02ee08745bc0babd662ed5067b306ff8aa90d4bb3d'
}

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 = '6.6.1'
s.version = '7.0.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 => '6.6.1' }
s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '7.0.0' }

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

s.dependency 'BrazeKit', '6.6.1'
s.dependency 'BrazeKit', '7.0.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 = '6.6.1'
s.version = '7.0.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 => '6.6.1' }
s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '7.0.0' }

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

s.dependency 'BrazeKitCompat', '6.6.1'
s.dependency 'BrazeKitCompat', '7.0.0'
s.dependency 'SDWebImage', '>= 5.8.2', '< 6'

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

##### Breaking
- The `useUUIDAsDeviceId` configuration is now enabled by default.
- For more details on the impacts, refer to this [Collecting IDFV - Swift](https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/initial_sdk_setup/other_sdk_customizations/swift_idfv/).
- The `Banner` Content Card type and corresponding UI elements have been renamed to `ImageOnly`. All member methods and properties remain the same.
- `Braze.ContentCard.Banner``Braze.ContentCard.ImageOnly`
- `BrazeContentCardUI.BannerCell``BrazeContentCardUI.ImageOnlyCell`
- Refactors some text layout logic in BrazeUI into a new `Braze.ModalTextView` class.
- Updates the behavior for Feature Flags methods.
- `FeatureFlags.featureFlag(id:)` now returns `nil` for an ID that does not exist.
- `FeatureFlags.subscribeToUpdates(:)` will trigger the callback when any refresh request completes with a success or failure.
- The callback will also trigger immediately upon initial subscription if previously cached data exists.

##### Fixed
- Fixes compiler warnings about Swift 6 when compiling `BrazeUI` while using Xcode 15.
- Exposes public imports for `ABKClassicImageContentCardCell.h` and `ABKControlTableViewCell.h` for use in the BrazeUICompat layer.
- Adds additional safeguards around invalid constraint values for `BrazeInAppMessageUI.SlideupView`

##### Added
- Adds the `enableDarkTheme` property to `BrazeContentCardUI.ViewController.Attributes`.
- Set this field to `false` to prevent the Content Cards feed UI from adopting dark theme styling when the device is in dark mode.
- This field is `true` by default.

## 6.6.1

##### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ + (Section *)cardSectionFromCard:(BRZContentCardRaw *)card
case BRZContentCardRawTypeClassic:
[fields addObject:[Field fieldWithName:@"type" value:@"classic"]];
break;
case BRZContentCardRawTypeBanner:
case BRZContentCardRawTypeImageOnly:
[fields addObject:[Field fieldWithName:@"type" value:@"banner"]];
break;
case BRZContentCardRawTypeCaptionedImage:
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/6.6.1/braze-swift-sdk-prebuilt.zip"
url="https://github.com/braze-inc/braze-swift-sdk/releases/download/7.0.0/braze-swift-sdk-prebuilt.zip"

echo "" "Cleaning up"
rm -rf braze-swift-sdk-prebuilt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// MARK: - Customizations

#warning("""
For demonstration purposes, this example application uses an alternate Content Card view controller initializer.
#warning(
"""
For demonstration purposes, this example application uses an alternate Content Card view controller initializer.
In your implementation, you are expected to use the standard `init(braze:attributes:)` initializer to automatically link the UI to your braze instance.
In your implementation, you are expected to use the standard `init(braze:attributes:)` initializer to automatically link the UI to your braze instance.
See https://braze-inc.github.io/braze-swift-sdk/documentation/brazeui/brazecontentcardui/viewcontroller/init(braze:attributes:)
""")
See https://braze-inc.github.io/braze-swift-sdk/documentation/brazeui/brazecontentcardui/viewcontroller/init(braze:attributes:)
""")

extension AppDelegate {

Expand Down Expand Up @@ -98,15 +99,15 @@ extension AppDelegate {
var attributes = BrazeContentCardUI.ViewController.Attributes.defaults

// Create two static cards
let headerCard: Braze.ContentCard = .banner(
let headerCard: Braze.ContentCard = .imageOnly(
.init(
data: .init(viewed: true),
image: .mockImage(
width: 1200, height: 675, text: "Static header card", backgroundColor: .systemOrange,
drawCorners: false)
)
)
let footerCard: Braze.ContentCard = .banner(
let footerCard: Braze.ContentCard = .imageOnly(
.init(
data: .init(viewed: true),
image: .mockImage(
Expand Down Expand Up @@ -192,6 +193,26 @@ extension AppDelegate {
navigationController.pushViewController(viewController, animated: true)
}

static func disableDarkThemeCustomization() {
var attributes = BrazeContentCardUI.ViewController.Attributes.defaults

attributes.enableDarkTheme = false

let viewController = BrazeContentCardUI.ViewController(
initialCards: cards,
attributes: attributes
)
viewController.title = "Dark Theme Disabled"

// This is necessary to stylize the `title` text, which is set off of
// `viewController`, but is actually situated under `navigationController.navigationBar`
// in the view hierarchy.
if #available(iOS 13.0, *) {
navigationController.navigationBar.overrideUserInterfaceStyle = .light
}
navigationController.pushViewController(viewController, animated: true)
}

}

// MARK: - Helpers
Expand All @@ -200,7 +221,7 @@ private var cards: [Braze.ContentCard] = [
classicPinned,
classic,
classicImage,
banner,
imageOnly,
captionedImage,
]

Expand Down
13 changes: 11 additions & 2 deletions Examples/Swift/Sources/ContentCardUI-Customization/Readme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ let actions: [(String, String, (ReadmeViewController) -> Void)] = [
"Modify the cards texts before display.",
transformCardsCustomization
),
(
"Disable dark theme",
"Make cards present in light theme even if the device is in dark mode.",
disableDarkThemeCustomization
),
]

// MARK: - Internal
Expand Down Expand Up @@ -88,8 +93,8 @@ let classicImage: Braze.ContentCard = withContext(
)
)

let banner: Braze.ContentCard = withContext(
.banner(
let imageOnly: Braze.ContentCard = withContext(
.imageOnly(
.init(
data: .init(clickAction: .url(URL(string: "https://example.com")!, useWebView: true)),
image: .mockImage(width: 1200, height: 675, text: "🧁", textSize: 256, drawCorners: false),
Expand Down Expand Up @@ -142,6 +147,10 @@ func transformCardsCustomization(_ viewController: ReadmeViewController) {
AppDelegate.transformCardsCustomization()
}

func disableDarkThemeCustomization(_ viewController: ReadmeViewController) {
AppDelegate.disableDarkThemeCustomization()
}

func withContext(_ card: Braze.ContentCard) -> Braze.ContentCard {
var card = card

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
switch card {
case .classic(let classic):
print("classic - title:", classic.title)
case .banner(let banner):
print("banner - image:", banner.image)
case .imageOnly(let imageOnly):
print("imageOnly - image:", imageOnly.image)
default:
break
}
Expand All @@ -63,8 +63,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
print("classic - title:", title)
}

if let image = card.banner?.image {
print("banner - image:", image)
if let image = card.imageOnly?.image {
print("imageOnly - image:", image)
}

// A wrapper / compatibility representation of the card is accessible via `.json()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ final class CardsInfoViewController: UITableViewController {
Field(name: "description", value: classicImage.description),
Field(name: "domain", value: classicImage.domain ?? "nil"),
]
case .banner(let banner):
type.value = "banner"
case .imageOnly(let imageOnly):
type.value = "imageOnly"
cardFields += [
Field(name: "image", value: banner.image),
Field(name: "imageAspectRatio", value: banner.imageAspectRatio ?? "nil"),
Field(name: "image", value: imageOnly.image),
Field(name: "imageAspectRatio", value: imageOnly.imageAspectRatio ?? "nil"),
]
case .captionedImage(let captionedImage):
type.value = "captionedImage"
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/6.6.1/braze-swift-sdk-prebuilt.zip"
url="https://github.com/braze-inc/braze-swift-sdk/releases/download/7.0.0/braze-swift-sdk-prebuilt.zip"

echo "" "Cleaning up"
rm -rf braze-swift-sdk-prebuilt
Expand Down
Loading

0 comments on commit f36aac0

Please sign in to comment.