Skip to content

Commit

Permalink
Version 5.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hokstuff committed Nov 30, 2022
1 parent bc848aa commit 7afd6e0
Show file tree
Hide file tree
Showing 14 changed files with 158 additions and 60 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 = '5.6.3'
s.version = '5.6.4'
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.6.3/BrazeKit-CocoaPods.zip',
:sha256 => '85e3fba03575d2f7a0ce6700ebd937869239a795c628a2cc5fd2058bdd592200'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazeKit-CocoaPods.zip',
:sha256 => '8029a5a48f7d91efb6d8150582c92445566ce1ba2c7e6048d13e64af53cc8f0a'
}

s.swift_version = '5.0'
Expand Down
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 = '5.6.3'
s.version = '5.6.4'
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.6.3/BrazeLocation-CocoaPods.zip',
:sha256 => '7d59c5764459822d55040dda168abf6f90dd39a8ae7ef8c2c8df1ad9cb16641f'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazeLocation-CocoaPods.zip',
:sha256 => 'f5fddf0bf389053d8e9e8eabe4600db2ef5ef8396e7b11430a65fac377d1522b'
}

s.swift_version = '5.0'
Expand All @@ -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.3'
s.dependency 'BrazeKit', '5.6.4'
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 = '5.6.3'
s.version = '5.6.4'
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/5.6.3/BrazeNotificationService-CocoaPods.zip',
:sha256 => 'fe116d58686797e3a47bde2c5e4da73c89d9aea7f6578c648b558c80dd2c99ed'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazeNotificationService-CocoaPods.zip',
:sha256 => '0e5c6ecc1f19db1cb12ea1a7749ebc1265434178695121509c326ec14c87c102'
}

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 = '5.6.3'
s.version = '5.6.4'
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/5.6.3/BrazePushStory-CocoaPods.zip',
:sha256 => 'd959ffbb2503d59f701023b8391d0d210c9f0c93fc15ac0771a3cd07c0a1d665'
:http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazePushStory-CocoaPods.zip',
:sha256 => 'f21f0c9655bb143790ac55e8ba105167b8ab7a5ef55df68992c0e61a91a24ecf'
}

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 = '5.6.3'
s.version = '5.6.4'
s.summary = 'Braze-provided user interface library for In-App Messages.'

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

s.swift_version = '5.0'
s.ios.deployment_target = '10.0'
Expand All @@ -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.3'
s.dependency 'BrazeKit', '5.6.4'
end
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## 5.6.4

##### 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.

##### Added
- Adds the public `id` field to `Braze.InAppMessage.Data`.
- Adds `logImpression(using:)` and `logClick(buttonId:using:)` to both in-app messages and content cards, and adds `logDismissed(using:)` to content cards.
- It is recommended to continue using the associated `Context` to log impressions, clicks, and dismissals for the majority of use cases.
- Adds Swift concurrency to support async/await versions of the following public methods. These methods can be used as alternatives to their corresponding counterparts that use completion handlers:
- [`Braze.User.id()`]
- [`Braze.deviceId()`]
- [`ContentCards.requestRefresh()`]
- [`ContentCards.cardsStream`] as an alternative to [`ContentCards.subscribeToUpdates(_:)`]

[`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(_:)

## 5.6.3

##### Fixed
Expand All @@ -6,7 +28,7 @@

##### Changed
- Improves error logging descriptions for HTTP requests and responses.

## 5.6.2

##### Changed
Expand Down
26 changes: 26 additions & 0 deletions Examples/ObjC/Sources/ContentCards/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>ContentCards</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
</dict>
</plist>
26 changes: 26 additions & 0 deletions Examples/ObjC/Sources/InAppMessages/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>InAppMessages</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
</dict>
</plist>
26 changes: 26 additions & 0 deletions Examples/Swift/Sources/ContentCards/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>ContentCards</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import UIKit
import BrazeKit

let performClickAction = "Perform click action"

final class InAppMessageInfoViewController: UITableViewController {

// Represents an in-app message property
Expand All @@ -21,12 +19,10 @@ final class InAppMessageInfoViewController: UITableViewController {
// MARK: - Properties

let sections: [Section]
let message: Braze.InAppMessage

// MARK: - Initialization

init(message: Braze.InAppMessage) {
self.message = message
sections = Self.messageSections(from: message) + Self.dataSections(from: message)
super.init(style: .grouped)
title = "In-App Message Info"
Expand Down Expand Up @@ -90,33 +86,6 @@ final class InAppMessageInfoViewController: UITableViewController {
sections[section].name
}

// MARK: - UITableViewDelegate

override func tableView(
_ tableView: UITableView,
didSelectRowAt indexPath: IndexPath
) {
guard let braze = AppDelegate.braze else { return }
let field = sections[indexPath.section].fields[indexPath.row]

if field.name == performClickAction {
// Trigger click action with custom UI
let context = Braze.InAppMessage.Context(message: message, using: braze)
context.logClick()
context.processClickAction(.url(URL(string: "https://www.braze.com")!, useWebView: false))
}
}

override func tableView(
_ tableView: UITableView,
willDisplay cell: UITableViewCell,
forRowAt indexPath: IndexPath
) {
guard let braze = AppDelegate.braze else { return }
let context = Braze.InAppMessage.Context(message: message, using: braze)
context.logImpression()
}

// MARK: - Helpers

/// The message specific sections (e.g. Slideup data, Modal data)
Expand Down Expand Up @@ -186,8 +155,6 @@ final class InAppMessageInfoViewController: UITableViewController {
break
}

section.fields += [Field(name: performClickAction, value: "")]

return [section, buttonsSection, themesSection].compactMap { $0 }
}

Expand Down
26 changes: 26 additions & 0 deletions Examples/Swift/Sources/InAppMessages/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>InAppMessages</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
</dict>
</plist>
16 changes: 8 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ let package = Package(
targets: [
.binaryTarget(
name: "BrazeKit",
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.3/BrazeKit.zip",
checksum: "e1b435f3d8e399133d6cff4fd3b32db45aadc02ee5a33f6183c2d086b1afd546"
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazeKit.zip",
checksum: "cc6375e451a181804528945a811a850444ae2d892f140491910237648bbe19ed"
),
.target(
name: "BrazeKitResources",
Expand All @@ -42,18 +42,18 @@ let package = Package(
),
.binaryTarget(
name: "BrazeLocation",
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.3/BrazeLocation.zip",
checksum: "e131e33933872210be316b744b91a99b76a944ea0d8e5963ed365af09438e14c"
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazeLocation.zip",
checksum: "33a0900c0ca9a9e5b94b86b111595e83e80b3723be7c0e7cc9e99bb03eb7c2b4"
),
.binaryTarget(
name: "BrazeNotificationService",
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.3/BrazeNotificationService.zip",
checksum: "be836f3b236c701a843b17a445052c3e85e98648b84880e4067096c51d660793"
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazeNotificationService.zip",
checksum: "32130b8da6bc00ce43ae2e495fd873cc1ec458b5c305d4bd9451cfe0d894a7f9"
),
.binaryTarget(
name: "BrazePushStory",
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.3/BrazePushStory.zip",
checksum: "e7bc9c80f9a573add5f508c203450623bddd2e473f3d205c8809ff7548ffebb9"
url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.6.4/BrazePushStory.zip",
checksum: "5b83874ae6eacf545c70e120655827976930da707e66297eba2f161bf5c1c089"
),
]
)
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/5.6.3/blue" alt="Version: 5.6.3">
<img src="https://badgen.net/badge/version/5.6.4/blue" alt="Version: 5.6.4">
</a>
<a href="#">
<img src="https://badgen.net/badge/platforms/iOS%20%7C%20tvOS%20%7C%20Mac%20Catalyst/orange"
Expand Down
7 changes: 6 additions & 1 deletion Sources/BrazeUI/InAppMessageUI/InAppMessageUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ open class BrazeInAppMessageUI:
/// The stack of in-app messages awaiting display.
///
/// When the conditions to display a message are not met at trigger time, the message is pushed
/// onto the stack.
/// onto the stack (which is the end of this array).
///
/// If an in-app message is already in the stack and fails to display again, it is moved to the top
/// of the stack.
public internal(set) var stack: [Braze.InAppMessage] = []

/// The object that act as the delegate for the in-app message UI.
Expand Down Expand Up @@ -228,6 +231,8 @@ open class BrazeInAppMessageUI:
{
guard messageView == nil else {
if push {
// Remove message from stack (if present) and place on top
stack.removeAll { $0.data.id == message.data.id }
stack.append(message)
}

Expand Down

0 comments on commit 7afd6e0

Please sign in to comment.