diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a59b023de..05b656b15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,36 +26,6 @@ jobs: job_name: "iOS SDK Release Started :apple_og:" url: ${{ secrets.SLACK_WEBHOOK }} - build-package: - needs: check-version - runs-on: macos-13-xlarge - steps: - - uses: actions/checkout@v4 - - name: Install Coreutils - run: brew install coreutils - - name: Install Apple Certificate - uses: apple-actions/import-codesign-certs@v1 - with: - p12-file-base64: ${{ secrets.CERTIFICATEXC }} - p12-password: ${{ secrets.CERTIFICATEXC_PASS }} - - name: Build SDK - run: make build-package XCODE=14.3.1 - - name: Upload zip distribution - uses: actions/upload-artifact@v3 - with: - name: airship - path: ./build/Airship.zip - - name: Upload zip distribution - uses: actions/upload-artifact@v3 - with: - name: airship-carthage - path: ./build/Airship.xcframeworks.zip - - name: Upload Documentation - uses: actions/upload-artifact@v3 - with: - name: docs - path: ./build/Documentation - build-package-xcode15: needs: check-version runs-on: macos-13-xlarge @@ -70,15 +40,15 @@ jobs: p12-password: ${{ secrets.CERTIFICATEXC_PASS }} - name: Build SDK run: make build-package - - name: Upload zip distribution + - name: Upload zip distribution for Xcode 15 uses: actions/upload-artifact@v3 with: - name: airship-xcode15 + name: Airship-Xcode15.zip path: ./build/Airship.zip - - name: Upload zip distribution + - name: Upload Xcode 15 Carthage zip distribution uses: actions/upload-artifact@v3 with: - name: airship-carthage-xcode15 + name: Airship-Xcode15.xcframeworks.zip path: ./build/Airship.xcframeworks.zip - name: Upload Documentation uses: actions/upload-artifact@v3 @@ -114,7 +84,7 @@ jobs: permissions: contents: write runs-on: macos-13-xlarge - needs: [run-tests, build-package, build-samples, build-package-xcode15] + needs: [run-tests, build-samples, build-package-xcode15] steps: - uses: actions/checkout@v4 - name: Get the version @@ -130,29 +100,18 @@ jobs: NOTES="${NOTES//$'\n'/%0A}" NOTES="${NOTES//$'\r'/%0D}" echo ::set-output name=NOTES::"$NOTES" - - name: Download zip distribution - uses: actions/download-artifact@v3 - with: - name: airship - path: ./build - - name: Download Carthage zip distribution - uses: actions/download-artifact@v3 - with: - name: airship-carthage-xcode15 - path: ./build - name: Download Xcode15 zip distribution uses: actions/download-artifact@v3 with: - name: airship-xcode15 - path: ./buildXcode15 + name: Airship-Xcode15.zip - name: Download Xcode15 Carthage zip distribution uses: actions/download-artifact@v3 with: - name: airship-carthage - path: ./buildXcode15 + name: Airship-Xcode15.xcframeworks.zip + - name: Github Release id: create_release - uses: actions/create-release@v1.1.4 + uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -161,42 +120,10 @@ jobs: body: ${{ steps.get_release_notes.outputs.NOTES }} draft: false prerelease: false - - name: Upload zip distribution - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/Airship.zip - asset_name: Airship.zip - asset_content_type: application/zip - - name: Upload carthage zip distribution - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/Airship.xcframeworks.zip - asset_name: Airship.xcframeworks.zip - asset_content_type: application/zip - - name: Upload Xcode15 zip distribution - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./buildXcode15/Airship.zip - asset_name: Airship-Xcode15.zip - asset_content_type: application/zip - - name: Upload Xcode 15 carthage zip distribution - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./buildXcode15/Airship.xcframeworks.zip - asset_name: Airship-Xcode15.xcframeworks.zip - asset_content_type: application/zip + files: | + Airship-Xcode15.zip + Airship-Xcode15.xcframeworks.zip + - name: Update prebuilt Xcode 14 repo env: GITHUB_TOKEN: ${{ secrets.IOS_DEPLOY_PREBUILT_PAT }} @@ -215,7 +142,7 @@ jobs: deploy-pods: runs-on: macos-13-xlarge - needs: [run-tests, build-package, build-samples] + needs: [run-tests, build-package-xcode15, build-samples] steps: - uses: actions/checkout@v4 - name: Get the version @@ -236,7 +163,7 @@ jobs: deploy-docs: runs-on: macos-13-xlarge - needs: [run-tests, build-package, build-samples] + needs: [run-tests, build-package-xcode15, build-samples] steps: - uses: actions/checkout@v4 - name: Get the version diff --git a/Airship.podspec b/Airship.podspec index cfe4ad65e..63980b0b5 100644 --- a/Airship.podspec +++ b/Airship.podspec @@ -1,4 +1,4 @@ -AIRSHIP_VERSION="17.9.0" +AIRSHIP_VERSION="17.9.1" Pod::Spec.new do |s| s.version = AIRSHIP_VERSION diff --git a/Airship/AirshipConfig.xcconfig b/Airship/AirshipConfig.xcconfig index 7f83e35cb..d601e0909 100644 --- a/Airship/AirshipConfig.xcconfig +++ b/Airship/AirshipConfig.xcconfig @@ -1,6 +1,6 @@ //* Copyright Airship and Contributors */ -CURRENT_PROJECT_VERSION = 17.9.0 +CURRENT_PROJECT_VERSION = 17.9.1 // Uncomment to include the preview build warning // OTHER_CFLAGS = $(inherited) -DUA_PREVIEW=1 diff --git a/Airship/AirshipCore/Source/AirshipContact.swift b/Airship/AirshipCore/Source/AirshipContact.swift index c13a32fa2..8c775188e 100644 --- a/Airship/AirshipCore/Source/AirshipContact.swift +++ b/Airship/AirshipCore/Source/AirshipContact.swift @@ -330,6 +330,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro @objc public func reset() { guard self.privacyManager.isEnabled(.contacts) else { + AirshipLogger.trace("Contacts are disabled, ignoring reset request") return } self.addOperation(.reset) @@ -342,6 +343,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro @objc public func notifyRemoteLogin() { guard self.privacyManager.isEnabled(.contacts) else { + AirshipLogger.trace("Contacts are disabled, ignoring notifyRemoteLogin request") return } self.addOperation(.verify(self.date.now, required: true)) @@ -353,6 +355,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro public func editTagGroups() -> TagGroupsEditor { return TagGroupsEditor { updates in guard !updates.isEmpty else { + AirshipLogger.trace("Empty tag group updates, ignoring") return } @@ -384,6 +387,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro public func editAttributes() -> AttributesEditor { return AttributesEditor { updates in guard !updates.isEmpty else { + AirshipLogger.trace("Empty attribute updates, ignoring") return } @@ -684,6 +688,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro private func addOperation(_ operation: ContactOperation) { self.serialQueue.enqueue { + AirshipLogger.trace("Adding contact operation \(operation.type)") await self.contactManager.addOperation(operation) } } diff --git a/Airship/AirshipCore/Source/AirshipVersion.swift b/Airship/AirshipCore/Source/AirshipVersion.swift index d264e7614..1b992e614 100644 --- a/Airship/AirshipCore/Source/AirshipVersion.swift +++ b/Airship/AirshipCore/Source/AirshipVersion.swift @@ -4,7 +4,7 @@ import Foundation @objc(UAirshipVersion) public class AirshipVersion: NSObject { - public static let version = "17.9.0" + public static let version = "17.9.1" @objc public class func get() -> String { diff --git a/Airship/AirshipCore/Source/ContactManager.swift b/Airship/AirshipCore/Source/ContactManager.swift index c82d63265..8336ec8cc 100644 --- a/Airship/AirshipCore/Source/ContactManager.swift +++ b/Airship/AirshipCore/Source/ContactManager.swift @@ -231,9 +231,13 @@ actor ContactManager: ContactManagerProtocol { // Worker -> one at a time private func perfromNextOperation() async throws -> Bool { - guard self.isEnabled else { return true } + guard self.isEnabled else { + AirshipLogger.trace("Contact manager is not enabled, unable to perform operation") + return true + } guard !self.operationEntries.isEmpty else { + AirshipLogger.trace("Operations are empty") return true } @@ -256,6 +260,7 @@ actor ContactManager: ContactManagerProtocol { yieldContactUpdates() guard let operationGroup = prepareNextOperationGroup() else { + AirshipLogger.trace("Next operation group is nil") return true } @@ -287,10 +292,13 @@ actor ContactManager: ContactManagerProtocol { } private func enqueueTask() { - guard - self.channel.identifier != nil, - self.isEnabled - else { + guard self.isEnabled else { + AirshipLogger.trace("Contact manager is not enabled, unable to enqueue task") + return + } + + guard self.channel.identifier != nil else { + AirshipLogger.trace("Channel not created, unable to enqueue task") return } @@ -323,7 +331,9 @@ actor ContactManager: ContactManagerProtocol { } private func performOperation(_ operation: ContactOperation) async throws -> Bool { + AirshipLogger.trace("Performing operation \(operation.type)") guard !self.isSkippable(operation: operation) else { + AirshipLogger.trace("Operation skippable, finished operation \(operation.type)") return true } @@ -778,7 +788,12 @@ actor ContactManager: ContactManagerProtocol { operationType == .resolve { self.operationEntries = self.operationEntries.filter { entry in - result.contact.channelAssociatedDate < entry.date + if (result.contact.channelAssociatedDate < entry.date) { + return true + } else { + AirshipLogger.trace("Dropping operation \(entry.operation.type) due to channel association date") + return false + } } } @@ -830,8 +845,7 @@ actor ContactManager: ContactManagerProtocol { channel: AssociatedChannel? = nil ) async { - guard let contactInfo = self.lastContactInfo, - contactInfo.contactID == contactID else { + guard let contactInfo = self.lastContactInfo, contactInfo.contactID == contactID else { return } diff --git a/Airship/AirshipMessageCenter/Source/theme/MessageCenterUtils.swift b/Airship/AirshipMessageCenter/Source/theme/MessageCenterUtils.swift index 135cef4a9..512bcf6bc 100644 --- a/Airship/AirshipMessageCenter/Source/theme/MessageCenterUtils.swift +++ b/Airship/AirshipMessageCenter/Source/theme/MessageCenterUtils.swift @@ -3,6 +3,20 @@ import Foundation import SwiftUI +extension ProgressView { + @ViewBuilder + func appearanceTint() -> some View { + if let color = UIRefreshControl.appearance().tintColor { + let color = Color(color) + if #available(iOS 15.0, *) { + self.tint(color) + } + } else { + self + } + } +} + extension Color { func adaptiveColor(for colorScheme: ColorScheme, darkVariation: Color?) -> Color? { if colorScheme == .light { diff --git a/Airship/AirshipMessageCenter/Source/views/MessageCenterListView.swift b/Airship/AirshipMessageCenter/Source/views/MessageCenterListView.swift index b1e1c6dd1..018c916eb 100644 --- a/Airship/AirshipMessageCenter/Source/views/MessageCenterListView.swift +++ b/Airship/AirshipMessageCenter/Source/views/MessageCenterListView.swift @@ -156,16 +156,11 @@ public struct MessageCenterListView: View { if !self.viewModel.messagesLoaded { ProgressView() + .appearanceTint() .opacity(1.0 - self.listOpacity) } else if self.messageIDs.isEmpty { VStack { - Button { - Task { - await self.viewModel.refreshList() - } - } label: { - Image(systemName: "arrow.clockwise") - } + refreshButton() Text("ua_empty_message_list".messageCenterlocalizedString) .opacity(1.0 - self.listOpacity) } @@ -280,19 +275,27 @@ public struct MessageCenterListView: View { private func editButton() -> some View { let isEditMode = self.editMode?.wrappedValue.isEditing ?? false - let color = - isEditMode - ? theme.cancelButtonTitleColor : (theme.editButtonTitleColor != nil) - ? theme.cancelButtonTitleColor?.adaptiveColor(for: colorScheme, darkVariation: theme.cancelButtonTitleColorDark) : - theme.editButtonTitleColor?.adaptiveColor(for: colorScheme, darkVariation: theme.editButtonTitleColorDark) - return EditButton().foregroundColor(color).accessibilityHint("ua_edit_messages_description".messageCenterlocalizedString) + var color: Color? = nil + + if isEditMode { + color = theme.cancelButtonTitleColor?.adaptiveColor(for: colorScheme, darkVariation: theme.cancelButtonTitleColorDark) + } else { + color = theme.editButtonTitleColor?.adaptiveColor(for: colorScheme, darkVariation: theme.editButtonTitleColorDark) + } + + return EditButton() + .foregroundColor(color) + .accessibilityHint("ua_edit_messages_description".messageCenterlocalizedString) } @ViewBuilder private func refreshButton() -> some View { + let refreshColor = theme.refreshTintColor?.adaptiveColor(for: colorScheme, darkVariation: theme.refreshTintColorDark) + if isRefreshing { ProgressView() + .appearanceTint() } else { Button { Task { @@ -302,6 +305,7 @@ public struct MessageCenterListView: View { } } label: { Image(systemName: "arrow.clockwise") + .foregroundColor(refreshColor) } .disabled(isRefreshing) .opacity(isRefreshing ? 0 : 1) diff --git a/Airship/AirshipMessageCenter/Source/views/MessageCenterMessageView.swift b/Airship/AirshipMessageCenter/Source/views/MessageCenterMessageView.swift index b84b48ee7..91ab5ac5d 100644 --- a/Airship/AirshipMessageCenter/Source/views/MessageCenterMessageView.swift +++ b/Airship/AirshipMessageCenter/Source/views/MessageCenterMessageView.swift @@ -395,7 +395,7 @@ private struct MessageCenterMessageContentView: View { .animation(.easeInOut(duration: 0.5), value: self.opacity) if case .loading = self.webViewPhase { - ProgressView() + ProgressView().appearanceTint() } else if case .error(let error) = self.webViewPhase { if let error = error as? MessageCenterMessageError, error == .messageGone diff --git a/Airship/AirshipMessageCenter/Source/views/MessageCenterView.swift b/Airship/AirshipMessageCenter/Source/views/MessageCenterView.swift index 83a7dfc77..d6cfbf2af 100644 --- a/Airship/AirshipMessageCenter/Source/views/MessageCenterView.swift +++ b/Airship/AirshipMessageCenter/Source/views/MessageCenterView.swift @@ -15,7 +15,8 @@ public struct MessageCenterView: View { @ObservedObject private var controller: MessageCenterController - @Environment(\.colorScheme) private var colorScheme + @Environment(\.colorScheme) + private var colorScheme @Environment(\.messageCenterDismissAction) private var dismissAction: (() -> Void)? diff --git a/AirshipContentExtension.podspec b/AirshipContentExtension.podspec index 6b52b0b1f..36af0d4dc 100644 --- a/AirshipContentExtension.podspec +++ b/AirshipContentExtension.podspec @@ -1,4 +1,4 @@ -AIRSHIP_VERSION="17.9.0" +AIRSHIP_VERSION="17.9.1" Pod::Spec.new do |s| s.version = AIRSHIP_VERSION diff --git a/AirshipDebug.podspec b/AirshipDebug.podspec index 222e39df7..3a2df1776 100644 --- a/AirshipDebug.podspec +++ b/AirshipDebug.podspec @@ -1,4 +1,4 @@ -AIRSHIP_VERSION="17.9.0" +AIRSHIP_VERSION="17.9.1" Pod::Spec.new do |s| s.version = AIRSHIP_VERSION diff --git a/AirshipServiceExtension.podspec b/AirshipServiceExtension.podspec index 3bfc3d8b1..5d5d1df72 100644 --- a/AirshipServiceExtension.podspec +++ b/AirshipServiceExtension.podspec @@ -1,4 +1,4 @@ -AIRSHIP_VERSION="17.9.0" +AIRSHIP_VERSION="17.9.1" Pod::Spec.new do |s| s.version = AIRSHIP_VERSION diff --git a/CHANGELOG.md b/CHANGELOG.md index eb1e0d7d9..11e9829ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ [Migration Guides](https://github.com/urbanairship/ios-library/tree/main/Documentation/Migration) +## Version 17.9.1, March 19, 2024 +Patch release with a bug fix for edit button theming in Message Center. + +### Changes +- Fixes color theme assignment for the edit button in Message Center. + ## Version 17.9.0, March 14, 2024 Minor release with several bug fixes and stability improvements.