Skip to content

Commit

Permalink
Version 5.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lowip committed Dec 15, 2022
1 parent 3d76957 commit 2a4c863
Show file tree
Hide file tree
Showing 386 changed files with 15,817 additions and 102 deletions.
8 changes: 5 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 = '5.7.0'
s.version = '5.8.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/5.7.0/BrazeKit-CocoaPods.zip',
:sha256 => 'dcef97f42830884252cecc2a46d863e7ed231e7b3d8cc734d35e849c57628415'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.8.0/BrazeKit-CocoaPods.zip',
:sha256 => 'bdf8cdde28e3dbbd0f3f089781e799a1922e5f6ee4f8299d4b8418ef053d8580'
}

s.swift_version = '5.0'
Expand All @@ -19,4 +19,6 @@ Pod::Spec.new do |s|

s.vendored_framework = 'BrazeKit.xcframework'
s.resource_bundles = { 'BrazeKit' => 'Sources/BrazeKitResources/Resources/**/*' }

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end
25 changes: 25 additions & 0 deletions BrazeKitCompat.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Pod::Spec.new do |s|
s.name = 'BrazeKitCompat'
s.version = '5.8.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 => '5.8.0' }

s.swift_version = '5.0'
s.ios.deployment_target = '10.0'
s.tvos.deployment_target = '10.0'
s.static_framework = true

s.source_files = 'Sources/BrazeKitCompat/**/*.{h,m}'
s.public_header_files = 'Sources/BrazeKitCompat/include/*.h'

s.dependency 'BrazeKit', '5.8.0'
s.dependency 'BrazeLocation', '5.8.0'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end
10 changes: 6 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 = '5.7.0'
s.version = '5.8.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/5.7.0/BrazeLocation-CocoaPods.zip',
:sha256 => '66372a30285e585189d20f20da3d602dd50f9541daee7bffd0b2729e28a19996'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.8.0/BrazeLocation-CocoaPods.zip',
:sha256 => '8d9b38a7df9714df3dcc2955de5914d6edef1e01852688ba0246498002a63318'
}

s.swift_version = '5.0'
Expand All @@ -21,5 +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', '5.7.0'
s.dependency 'BrazeKit', '5.8.0'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end
8 changes: 5 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 = '5.7.0'
s.version = '5.8.0'
s.summary = 'Braze notification service extension library providing support for Rich Push notifications.'

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

s.source = {
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazeNotificationService-CocoaPods.zip',
:sha256 => '335ce992d5a53b0efc79097ea77ccf092ff92013d9a7e58d02ef7f86763b8c70'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.8.0/BrazeNotificationService-CocoaPods.zip',
:sha256 => '3b61399b20b56c58ee897b3a0c80cc22d002f0bbc0369152352e5bc9d4691a17'
}

s.swift_version = '5.0'
s.ios.deployment_target = '10.0'

s.vendored_framework = 'BrazeNotificationService.xcframework'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end
8 changes: 5 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 = '5.7.0'
s.version = '5.8.0'
s.summary = 'Braze notification content extension library providing support for Push Stories.'

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

s.source = {
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.7.0/BrazePushStory-CocoaPods.zip',
:sha256 => '741f055974e9e4fb70810ba716fe2177ad486bd7b7d32779a65087a6055bb597'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.8.0/BrazePushStory-CocoaPods.zip',
:sha256 => 'e9a98b6a947d221b679e3a073670621d30518b1d93fdcf6ae4257526ada13a08'
}

s.swift_version = '5.0'
s.ios.deployment_target = '10.0'

s.vendored_framework = 'BrazePushStory.xcframework'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end
10 changes: 6 additions & 4 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 = '5.7.0'
s.summary = 'Braze-provided user interface library for In-App Messages.'
s.version = '5.8.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 => '5.7.0' }
s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '5.8.0' }

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

s.dependency 'BrazeKit', '5.7.0'
s.dependency 'BrazeKit', '5.8.0'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
end
29 changes: 29 additions & 0 deletions BrazeUICompat.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Pod::Spec.new do |s|
s.name = 'BrazeUICompat'
s.version = '5.8.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 => '5.8.0' }

s.swift_version = '5.0'
s.ios.deployment_target = '10.0'
s.static_framework = true

s.source_files = 'Sources/BrazeUICompat/ABK*/**/*.{h,m}'
s.public_header_files = 'Sources/BrazeUICompat/ABK*/**/*.h'
s.resource_bundles = { 'BrazeUICompat' => 'Sources/BrazeUICompat/*/Resources/**/*.*' }

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

s.user_target_xcconfig = { 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES' }
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'OTHER_CFLAGS' => '-Wno-deprecated-declarations -Wno-deprecated-implementations'
}
end
32 changes: 30 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 5.8.0

To help migrate your app from the Appboy-iOS-SDK to our Swift SDK, this release includes the `Appboy-iOS-SDK` [migration guide]:
- Follow step-by-step instructions to migrate each feature to the new APIs.
- Includes instructions for a minimal migration scenario via our compatibility libraries.

##### Added
- Adds compatibility libraries `BrazeKitCompat` and `BrazeUICompat`:
- Provides all the old APIs from `Appboy-iOS-SDK` to easily start migrating to the Swift SDK.
- See the [migration guide] for more details.
- Adds support for [News Feed](https://www.braze.com/docs/user_guide/engagement_tools/news_feed) data models and analytics.
- News Feed UI is not supported by the Swift SDK. See the [migration guide] for instructions on using the compatibility UI.

[migration guide]: https://braze-inc.github.io/braze-swift-sdk/documentation/braze/appboy-migration-guide

## 5.7.0

##### Fixed
Expand All @@ -14,6 +29,17 @@

## 5.6.4

##### End of early access phase / Migration Guide / Compatibility Libraries

This release marks the end of the early access phase for the Braze Swift SDK. `Appboy-iOS-SDK` is now deprecated and support will cease on <INSERT DATE HERE>.

To help with your migration process, this release includes:
- [Appboy-iOS-SDK: Migration guide]:
- Follow step-by-step instructions to migrate each feature to the new APIs.
- Includes instructions for minimal migration scenario via our compatibility libraries.
- Compatibility libraries `BrazeKitCompat` and `BrazeUICompat`:
- Provides all the old APIs from `Appboy-iOS-SDK` to easily start migrating to the Swift SDK.

##### Fixed
- Fixes an issue preventing the execution of `BrazeDelegate` methods when setting the delegate using Objective-C.
- Fixes an issue where triggering an in-app message twice with the same event did not place the message on the in-app message stack under certain conditions.
Expand All @@ -27,7 +53,8 @@
- [`Braze.deviceId()`]
- [`ContentCards.requestRefresh()`]
- [`ContentCards.cardsStream`] as an alternative to [`ContentCards.subscribeToUpdates(_:)`]


[Appboy-iOS-SDK: Migration guide]: https://braze-inc.github.io/braze-swift-sdk/documentation/braze/appboy-migration-guide
[`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()
Expand Down Expand Up @@ -205,6 +232,7 @@ The following features are not supported yet:
- Added in [5.5.0](#550)
- ~~tvOS integration~~
- Added in [5.3.0](#530)
- News Feed
- ~~News Feed~~
- Added in [5.7.0](#570)
- ~~Content Cards~~
- Added in [5.2.0](#520)
4 changes: 2 additions & 2 deletions Examples/Swift/Package.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This Package.swift is intentionally empty. It exists for the sole purpose of preventing Xcode
// from recursively including the Examples project sources when locally referencing the Braze SDK
// This Package.swift is intentionally empty. It exists for the sole purpose of preventing Xcode
// from recursively including the Examples project sources when locally referencing the Braze SDK
// SwiftPM package.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ 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 @@ -103,13 +101,17 @@ extension AppDelegate {
let headerCard: Braze.ContentCard = .banner(
.init(
data: .init(viewed: true),
image: .mockImage(width: 1200, height: 675, text: "Static header card", backgroundColor: .systemOrange, drawCorners: false)
image: .mockImage(
width: 1200, height: 675, text: "Static header card", backgroundColor: .systemOrange,
drawCorners: false)
)
)
let footerCard: Braze.ContentCard = .banner(
.init(
data: .init(viewed: true),
image: .mockImage(width: 1200, height: 675, text: "Static footer card", backgroundColor: .systemOrange, drawCorners: false)
image: .mockImage(
width: 1200, height: 675, text: "Static footer card", backgroundColor: .systemOrange,
drawCorners: false)
)
)
Expand Down Expand Up @@ -199,10 +201,9 @@ private var cards: [Braze.ContentCard] = [
classic,
classicImage,
banner,
captionedImage
captionedImage,
]
private var navigationController: UINavigationController {
UIApplication.shared.delegate!.window!!.rootViewController! as! UINavigationController
}

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ let actions: [(String, String, (ReadmeViewController) -> Void)] = [
let classicPinned: Braze.ContentCard = withContext(
.classic(
.init(
data: .init(clickAction: .url(URL(string: "https://example.com")!, useWebView: true), pinned: true),
data: .init(
clickAction: .url(URL(string: "https://example.com")!, useWebView: true), pinned: true),
title: "Classic (pinned)",
description: "Cupcake ipsum dolor sit amet. Topping dessert muffin fruitcake.",
domain: "example.com"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import UIKit
import BrazeKit
import BrazeUI
import UIKit

/// A ClassicImageCell subclass which move the image to the trailing part of the cell, make it take
/// the full height of the cell.
Expand Down Expand Up @@ -29,7 +29,8 @@ class CustomClassicImageCell: BrazeContentCardUI.ClassicImageCell {

// Use the original left padding for the text stack + support RTL languages
textStack?.isLayoutMarginsRelativeArrangement = true
let isRightToLeft = UIView.userInterfaceLayoutDirection(for: semanticContentAttribute) == .rightToLeft
let isRightToLeft =
UIView.userInterfaceLayoutDirection(for: semanticContentAttribute) == .rightToLeft
textStack?.layoutMargins = UIEdgeInsets(
top: 0,
left: isRightToLeft ? 0 : attributes.padding.left,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// A wrapper / compatibility representation of the card is accessible via `.json()`
if let jsonData = card.json(),
let jsonString = String(data: jsonData, encoding: .utf8) {
let jsonString = String(data: jsonData, encoding: .utf8)
{
print(jsonString)
}

Expand Down Expand Up @@ -109,7 +110,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// A wrapper / compatibility representation of the card is accessible via `.json()`
if let jsonData = cardRaw.json(),
let jsonString = String(data: jsonData, encoding: .utf8) {
let jsonString = String(data: jsonData, encoding: .utf8)
{
print(jsonString)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import UIKit
import BrazeKit
import UIKit

final class CardsInfoViewController: UITableViewController {

Expand All @@ -26,7 +26,8 @@ final class CardsInfoViewController: UITableViewController {
sections = cards.enumerated().map { Self.cardSection(from: $1, index: $0) }
super.init(style: .grouped)
title = "Content Cards Info"
let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(dismissModal))
let doneButton = UIBarButtonItem(
barButtonSystemItem: .done, target: self, action: #selector(dismissModal))
navigationItem.setRightBarButton(doneButton, animated: false)

tableView.rowHeight = UITableView.automaticDimension
Expand Down Expand Up @@ -62,7 +63,8 @@ final class CardsInfoViewController: UITableViewController {
_ tableView: UITableView,
cellForRowAt indexPath: IndexPath
) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cellIdentifier")
let cell =
tableView.dequeueReusableCell(withIdentifier: "cellIdentifier")
?? UITableViewCell(style: .value1, reuseIdentifier: "cellIdentifier")

let field = sections[indexPath.section].fields[indexPath.row]
Expand Down Expand Up @@ -162,7 +164,7 @@ final class CardsInfoViewController: UITableViewController {
header.value = "url"
fields = [
Field(name: "url", value: url, indentation: indentation + 1),
Field(name: "useWebView", value: useWebView, indentation: indentation + 1)
Field(name: "useWebView", value: useWebView, indentation: indentation + 1),
]
@unknown default:
break
Expand All @@ -171,5 +173,4 @@ final class CardsInfoViewController: UITableViewController {
return [header] + fields
}


}
1 change: 0 additions & 1 deletion Examples/Swift/Sources/ContentCards-Custom-UI/Readme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,3 @@ func cancelContentCardsUpdatesSubscription(_ viewController: ReadmeViewControlle
func presentContentCardsInfoViewController(_ viewController: ReadmeViewController) {
(UIApplication.shared.delegate as? AppDelegate)?.presentContentCardsInfoViewController()
}

Loading

0 comments on commit 2a4c863

Please sign in to comment.