From c600aa5115f826079098e2278992aeb387ee73d1 Mon Sep 17 00:00:00 2001 From: Daniel Hok Date: Wed, 7 Sep 2022 15:01:15 -0400 Subject: [PATCH] Version 5.4.0 --- BrazeKit.podspec | 6 +- BrazeLocation.podspec | 8 +- BrazeNotificationService.podspec | 6 +- BrazePushStory.podspec | 6 +- BrazeUI.podspec | 6 +- CHANGELOG.md | 20 ++-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 -- .../xcshareddata/swiftpm/Package.resolved | 106 ------------------ .../ContentCards-In-House-UI/Info.plist | 26 +++++ .../InAppMessages-In-House-UI/Info.plist | 26 +++++ Package.swift | 16 +-- .../InAppMessageUI/InAppMessageMocks.swift | 2 +- .../InAppMessageUI/InAppMessageUIError.swift | 15 +++ 13 files changed, 102 insertions(+), 149 deletions(-) delete mode 100644 Examples/Examples-SwiftPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 Examples/Examples-SwiftPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 Examples/Sources/ContentCards-In-House-UI/Info.plist create mode 100644 Examples/Sources/InAppMessages-In-House-UI/Info.plist diff --git a/BrazeKit.podspec b/BrazeKit.podspec index 1e46262d4c..851cda5a93 100644 --- a/BrazeKit.podspec +++ b/BrazeKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazeKit' - s.version = '5.3.2' + s.version = '5.4.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.3.2/BrazeKit-CocoaPods.zip', - :sha256 => '9e239c58b20daf14d029671a4d0736ffcd1290d3aedb225530733bb520c0a2a1' + :http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.4.0/BrazeKit-CocoaPods.zip', + :sha256 => '4228d1670c639b4139d6530d41c06e0ac670f0f4f6f517e836168aae007fbe42' } s.swift_version = '5.0' diff --git a/BrazeLocation.podspec b/BrazeLocation.podspec index 7478cf50ee..5c17d9f4f4 100644 --- a/BrazeLocation.podspec +++ b/BrazeLocation.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazeLocation' - s.version = '5.3.2' + s.version = '5.4.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.3.2/BrazeLocation-CocoaPods.zip', - :sha256 => '1206b7bce2da0b93c2d6e383a6878f716752b4ac9ff48d267fc1cec88c6d19a2' + :http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.4.0/BrazeLocation-CocoaPods.zip', + :sha256 => '26f732381af0031999ea19bb4386cfe999db4d467786f18449f075e82c55f6d6' } 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.3.2' + s.dependency 'BrazeKit', '5.4.0' end diff --git a/BrazeNotificationService.podspec b/BrazeNotificationService.podspec index 3c4b599fe0..15803f5a05 100644 --- a/BrazeNotificationService.podspec +++ b/BrazeNotificationService.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazeNotificationService' - s.version = '5.3.2' + s.version = '5.4.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.3.2/BrazeNotificationService-CocoaPods.zip', - :sha256 => '553907894d384cfa0e9f47f46120c964da3fe38f0330dd5c0f6f37140489d643' + :http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.4.0/BrazeNotificationService-CocoaPods.zip', + :sha256 => '3ad4ccb1557c338f8a5018731aa6b543f523326cc54a055127a8c66d5ff212d4' } s.swift_version = '5.0' diff --git a/BrazePushStory.podspec b/BrazePushStory.podspec index e7daf559cb..228f11c529 100644 --- a/BrazePushStory.podspec +++ b/BrazePushStory.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazePushStory' - s.version = '5.3.2' + s.version = '5.4.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.3.2/BrazePushStory-CocoaPods.zip', - :sha256 => '352f37e0c9877165f1a44416157f4c784f0db2de5f08ccaf34cea26663e9f50f' + :http => 'https://github.com/braze-inc/braze-swift-sdk/releases/download/5.4.0/BrazePushStory-CocoaPods.zip', + :sha256 => '47d56c8a5a79e72d2a87744d8f3207ee3a09943f460cf7d11d4a12ff97df1cdd' } s.swift_version = '5.0' diff --git a/BrazeUI.podspec b/BrazeUI.podspec index d8f179d81d..5e6d4e3b57 100644 --- a/BrazeUI.podspec +++ b/BrazeUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'BrazeUI' - s.version = '5.3.2' + s.version = '5.4.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.3.2' } + s.source = { :git => 'https://github.com/braze-inc/braze-swift-sdk.git', :tag => '5.4.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.3.2' + s.dependency 'BrazeKit', '5.4.0' end diff --git a/CHANGELOG.md b/CHANGELOG.md index 548bc8c7bf..7feea1aefe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,20 +1,25 @@ -## 5.3.2 +## 5.4.0 ##### Fixed +- Fixes an issue where `brazeBridge.logClick(button_id)` would incorrectly accept invalid `button_id` values like `""`, `[]`, or `{}`. + +##### Added +- Adds support for Braze Action Deeplink Click Actions. +## 5.3.2 + +##### Fixed - Fixes an issue preventing compilation when importing `BrazeUI` via SwiftPM in specific cases. - Lowers `BrazeUI` minimum deployment target to iOS 10.0. ## 5.3.1 ##### Fixed - - Fixes an HTML in-app message issue where clicking a link in an iFrame would launch a separate webview and close the message, instead of redirecting within the iFrame. - Fixes the rounding of In-App Message modal view top corners. - Fixes the display of modals and full screen in-app messages on iPads in landscape mode. ##### Added - - Adds two Example schemes: - InAppMessage-Custom-UI: - Demonstrates how to implement your own custom In-App Message UI. @@ -25,36 +30,31 @@ - Adds [`Braze.InAppMessage.ClickAction.uri`](https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/inappmessage/clickaction/uri) for direct access. - Adds [`Braze.ContentCard.ClickAction.uri`](https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/braze/contentcard/clickaction/uri/) for direct access. - Adds [`Braze.deviceId(queue:completion:)`](https://braze-inc.github.io/braze-swift-sdk/documentation/brazekit/brazekit/braze/deviceid(queue:completion:)) to retrieve the device identifier used by Braze. - + ## 5.3.0 ##### Added - - Adds support for tvOS. - See the schemes _Analytics-tvOS_ and _Location-tvOS_ in the [Examples](Examples/) project. ## 5.2.0 ##### Added - - Adds [Content Cards](https://www.braze.com/docs/user_guide/message_building_by_channel/content_cards) support. - See the [_Content Cards UI_](https://braze-inc.github.io/braze-swift-sdk/tutorials/braze/c2-contentcardsui) tutorial to get started. ##### Changed - -- Raises `BrazeUI` minimum deployment target to iOS 11.0 when integrating via CocoaPods to allow providing SwiftUI compatible Views. +- Raises `BrazeUI` minimum deployment target to iOS 11.0 to allow providing SwiftUI compatible Views. ## 5.1.0 ##### Fixed - - Fixes an issue where the SDK would be unable to present a webview when the application was already presenting a modal view controller. - Fixes an issue preventing a full device data update after changing the identified user. - Fixes an issue preventing events and user attributes from being flushed automatically under certain conditions. - Fixes an issue delaying updates to push notifications settings. ##### Added - - Adds CocoaPods support. - Pods: - [BrazeKit](https://cocoapods.org/pods/BrazeKit) diff --git a/Examples/Examples-SwiftPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/Examples-SwiftPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d..0000000000 --- a/Examples/Examples-SwiftPM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Examples/Examples-SwiftPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Examples/Examples-SwiftPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 31573d6f84..0000000000 --- a/Examples/Examples-SwiftPM.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,106 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "SDWebImage", - "repositoryURL": "https://github.com/SDWebImage/SDWebImage", - "state": { - "branch": null, - "revision": "3e48cb68d8e668d146dc59c73fb98cb628616236", - "version": "5.13.2" - } - }, - { - "package": "swift-algorithms", - "repositoryURL": "https://github.com/apple/swift-algorithms", - "state": { - "branch": null, - "revision": "b14b7f4c528c942f121c8b860b9410b2bf57825e", - "version": "1.0.0" - } - }, - { - "package": "BrazeArchitecture", - "repositoryURL": "git@github.com:braze-inc/swift-architecture.git", - "state": { - "branch": "29aa1d2", - "revision": "29aa1d2db79affcc2d43b25a3ecfb9f63e1c8044", - "version": null - } - }, - { - "package": "swift-argument-parser", - "repositoryURL": "https://github.com/apple/swift-argument-parser", - "state": { - "branch": null, - "revision": "9f39744e025c7d377987f30b03770805dcb0bcd1", - "version": "1.1.4" - } - }, - { - "package": "swift-numerics", - "repositoryURL": "https://github.com/apple/swift-numerics", - "state": { - "branch": null, - "revision": "0a5bc04095a675662cf24757cc0640aa2204253b", - "version": "1.0.2" - } - }, - { - "package": "SnapshotTesting", - "repositoryURL": "https://github.com/braze-inc/swift-snapshot-testing.git", - "state": { - "branch": "braze-changes", - "revision": "2b099d50fa337cf88d7b3d9c65880d0f905976fb", - "version": null - } - }, - { - "package": "swift-system", - "repositoryURL": "https://github.com/apple/swift-system.git", - "state": { - "branch": null, - "revision": "836bc4557b74fe6d2660218d56e3ce96aff76574", - "version": "1.1.1" - } - }, - { - "package": "swift-tools-support-core", - "repositoryURL": "https://github.com/apple/swift-tools-support-core", - "state": { - "branch": null, - "revision": "0b77e67c484e532444ceeab60119b8536f8cd648", - "version": "0.3.0" - } - }, - { - "package": "SwiftCommand", - "repositoryURL": "https://github.com/Zollerboy1/SwiftCommand.git", - "state": { - "branch": null, - "revision": "b4ea08c1db90532e62e1d2ea44d1c7b630b45350", - "version": "1.1.2" - } - }, - { - "package": "SwiftSoup", - "repositoryURL": "https://github.com/scinfu/SwiftSoup.git", - "state": { - "branch": null, - "revision": "6778575285177365cbad3e5b8a72f2a20583cfec", - "version": "2.4.3" - } - }, - { - "package": "XCResultKit", - "repositoryURL": "https://github.com/davidahouse/XCResultKit", - "state": { - "branch": null, - "revision": "2fe24c2675432c4b8c8d7ab0364e2760190b6fea", - "version": "0.9.3" - } - } - ] - }, - "version": 1 -} diff --git a/Examples/Sources/ContentCards-In-House-UI/Info.plist b/Examples/Sources/ContentCards-In-House-UI/Info.plist new file mode 100644 index 0000000000..e8c26c902a --- /dev/null +++ b/Examples/Sources/ContentCards-In-House-UI/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + ContentCards-In-House-UI + 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/Sources/InAppMessages-In-House-UI/Info.plist b/Examples/Sources/InAppMessages-In-House-UI/Info.plist new file mode 100644 index 0000000000..59751b10e0 --- /dev/null +++ b/Examples/Sources/InAppMessages-In-House-UI/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + InAppMessages-In-House-UI + 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 348cffeabd..996e880073 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.3.2/BrazeKit.zip", - checksum: "f7cb7563ad60598bec09948a1f5694d62443d237e9f4f6e15011176b6d36971f" + url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.4.0/BrazeKit.zip", + checksum: "384a541e56b6c56ecdf787ab31cd217f89388e98e76c9d05e0d39a6dc85e3b5a" ), .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.3.2/BrazeLocation.zip", - checksum: "83896e93aa4880bccf01827aa9c3a60f75b786e23e316c8986240bd7f52b85d9" + url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.4.0/BrazeLocation.zip", + checksum: "541c9164a0936c05252cb6f45969a2b46c3e7cfe403a664304a3744f5c3c5a52" ), .binaryTarget( name: "BrazeNotificationService", - url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.3.2/BrazeNotificationService.zip", - checksum: "eb1dc33d9412accce3734cf3ba774cee624993faaf52b5d14cc295d2ae9e3537" + url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.4.0/BrazeNotificationService.zip", + checksum: "86881788339faa3729dc35f81315c60ccc138d789af831ae7b64d62ccc28cb7d" ), .binaryTarget( name: "BrazePushStory", - url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.3.2/BrazePushStory.zip", - checksum: "621fc728f28007134b4099fe0204b8f8f1919186404849fbd2d8b2fb4651c53f" + url: "https://github.com/braze-inc/braze-swift-sdk/releases/download/5.4.0/BrazePushStory.zip", + checksum: "074c61f50c662f2eb4dd81562f7ffa5f774207932008e3dfa6a7224a61005816" ), ] ) diff --git a/Sources/BrazeUI/InAppMessageUI/InAppMessageMocks.swift b/Sources/BrazeUI/InAppMessageUI/InAppMessageMocks.swift index aca133d793..9bddf09076 100644 --- a/Sources/BrazeUI/InAppMessageUI/InAppMessageMocks.swift +++ b/Sources/BrazeUI/InAppMessageUI/InAppMessageMocks.swift @@ -499,7 +499,7 @@ import Foundation extension Braze.InAppMessage.ClickAction { - public static let mock: Self = .uri(URL(string: "https://example.com")!, useWebView: false) + public static let mock = Self.uri(URL(string: "https://example.com")!, useWebView: false) } diff --git a/Sources/BrazeUI/InAppMessageUI/InAppMessageUIError.swift b/Sources/BrazeUI/InAppMessageUI/InAppMessageUIError.swift index 43562ab4c9..a8bcff00c9 100644 --- a/Sources/BrazeUI/InAppMessageUI/InAppMessageUIError.swift +++ b/Sources/BrazeUI/InAppMessageUI/InAppMessageUIError.swift @@ -6,6 +6,7 @@ extension BrazeInAppMessageUI { case noContextLogImpression case noContextLogClick case noContextProcessClickAction + case invalidBrazeActions case noMainThread case noMessageView @@ -38,6 +39,8 @@ extension BrazeInAppMessageUI.Error { return "Cannot log click for non-braze in-app message." case .noContextProcessClickAction: return "Cannot process click action for non-braze in-app message." + case .invalidBrazeActions: + return "Invalid Braze Actions found in click action. Skipping display." case .noMainThread: return @@ -110,6 +113,18 @@ extension Braze.WebViewBridge.ScriptMessageHandler.Error { """ case .deprecation(let message): return message + case .pushAlreadyEnabled: + return + """ + Unable to process JavaScript bridge action to request push permission. + - Push is already enabled. + """ + case .invalidPushAuthStatus: + return + """ + Unable to process JavaScript bridge action to request push permission. + - Push authorization status not found. + """ case .unknown(let error): return error.logDescription @unknown default: