Skip to content

Commit

Permalink
17.2.1 (#2816)
Browse files Browse the repository at this point in the history
* Fix LA stale date handling

* Release 17.2.1

* Fix Xcode15 builds
  • Loading branch information
rlepinski authored Aug 29, 2023
1 parent 3ebe4b1 commit a9ccfdc
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 49 deletions.
49 changes: 16 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:

deploy-github:
runs-on: macOS-13
needs: [run-tests, build-package, build-samples]
needs: [run-tests, build-package, build-samples, build-package-xcode15]
steps:
- uses: actions/checkout@v2
- name: Get the version
Expand Down Expand Up @@ -168,6 +168,16 @@ jobs:
with:
name: airship-carthage
path: ./build
- name: Download Xcode15 zip distribution
uses: actions/download-artifact@v1
with:
name: airship
path: ./buildXcode15
- name: Download Xcode15 Carthage zip distribution
uses: actions/download-artifact@v1
with:
name: airship-carthage
path: ./buildXcode15
- name: Github Release
id: create_release
uses: actions/[email protected]
Expand Down Expand Up @@ -201,49 +211,22 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.IOS_DEPLOY_PREBUILT_PAT }}
run: gh --repo urbanairship/ios-library-prebuilt workflow run release.yml

- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: "Deploy iOS SDK to Github :octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
deploy-github-xcode15:
runs-on: macOS-13
needs: [build-package-xcode15, deploy-github]
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Download zip distribution
uses: actions/download-artifact@v1
with:
name: airship-xcode15
path: ./build
- name: Download Carthage zip distribution
uses: actions/download-artifact@v1
with:
name: airship-carthage-xcode15
path: ./build
- name: Upload zip distribution
- name: Upload Xcode15 zip distribution
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/Airship.zip
asset_path: ./buildXcode15/Airship.zip
asset_name: Airship-Xcode15.zip
asset_content_type: application/zip
- name: Upload carthage zip distribution
- name: Upload Xcode 15 carthage zip distribution
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/Airship.xcframeworks.zip
asset_path: ./buildXcode15/Airship.xcframeworks.zip
asset_name: Airship-Xcode15.xcframeworks.zip
asset_content_type: application/zip

Expand All @@ -252,7 +235,7 @@ jobs:
if: always()
with:
type: ${{ job.status }}
job_name: "Deploy iOS SDK Xcode 15 to Github :octocat:"
job_name: "Deploy iOS SDK to Github :octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
deploy-pods:
runs-on: macOS-13
Expand Down
2 changes: 1 addition & 1 deletion Airship.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="17.2.0"
AIRSHIP_VERSION="17.2.1"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
2 changes: 1 addition & 1 deletion Airship/AirshipConfig.xcconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//* Copyright Airship and Contributors */

CURRENT_PROJECT_VERSION = 17.2.0
CURRENT_PROJECT_VERSION = 17.2.1

// Uncomment to include the preview build warning
// OTHER_CFLAGS = $(inherited) -DUA_PREVIEW=1
2 changes: 1 addition & 1 deletion Airship/AirshipCore/Source/AirshipVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation

@objc(UAirshipVersion)
public class AirshipVersion: NSObject {
public static let version = "17.2.0"
public static let version = "17.2.1"

@objc
public class func get() -> String {
Expand Down
21 changes: 16 additions & 5 deletions Airship/AirshipCore/Source/LiveActivity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ protocol LiveActivityProtocol: Sendable {
/// The activity's ID
var id: String { get }

var isActive: Bool { get }
var isUpdatable: Bool { get }

var pushTokenString: String? { get }

Expand Down Expand Up @@ -38,8 +38,8 @@ fileprivate struct ActivityProvider<T : ActivityAttributes>: Sendable {
struct LiveActivity<T: ActivityAttributes>: LiveActivityProtocol {
public let id: String

public var isActive: Bool {
return provider.getActivity()?.activityState == .active
public var isUpdatable: Bool {
return provider.getActivity()?.activityState.isStaleOrActive ?? false
}

public var pushTokenString: String? {
Expand Down Expand Up @@ -72,7 +72,7 @@ struct LiveActivity<T: ActivityAttributes>: LiveActivityProtocol {

let task = Task {
guard let activity = provider.getActivity(),
activity.activityState == .active
activity.activityState.isStaleOrActive
else {
return
}
Expand All @@ -96,7 +96,7 @@ struct LiveActivity<T: ActivityAttributes>: LiveActivityProtocol {
}

for await update in activity.activityStateUpdates {
if update != .active || Task.isCancelled {
if !update.isStaleOrActive || Task.isCancelled {
await backgroundTask.stop()
task.cancel()
break
Expand All @@ -105,6 +105,17 @@ struct LiveActivity<T: ActivityAttributes>: LiveActivityProtocol {
}
}

@available(iOS 16.1, *)
extension ActivityState {
public var isStaleOrActive: Bool {
if #available(iOS 16.2, *) {
return self == .active || self == .stale
} else {
return self == .active
}
}
}


extension Data {
fileprivate var tokenString: String {
Expand Down
2 changes: 1 addition & 1 deletion Airship/AirshipCore/Source/LiveActivityRegistry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ actor LiveActivityRegistry {
name: String
) {

guard liveActivity.isActive else {
guard liveActivity.isUpdatable else {
return
}

Expand Down
8 changes: 4 additions & 4 deletions Airship/AirshipCore/Tests/LiveActivityRegistryTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class LiveActivityRegistryTest: XCTestCase {
)

self.date.offset += 1.0
activity.isActive = false
activity.isUpdatable = false

await assertUpdate(
LiveActivityUpdate(
Expand Down Expand Up @@ -196,9 +196,9 @@ final class LiveActivityRegistryTest: XCTestCase {
/// Tried to match as closely as I coudl to the real object
private final class TestLiveActivity: LiveActivityProtocol, @unchecked Sendable {
let id: String
var isActive: Bool = true {
var isUpdatable: Bool = true {
didSet {
statusUpdatesContinuation.yield(isActive)
statusUpdatesContinuation.yield(isUpdatable)
}
}
var pushTokenString: String? {
Expand Down Expand Up @@ -229,7 +229,7 @@ private final class TestLiveActivity: LiveActivityProtocol, @unchecked Sendable
}

func track(tokenUpdates: @escaping (String) async -> Void) async {
guard self.isActive else {
guard self.isUpdatable else {
return
}

Expand Down
2 changes: 1 addition & 1 deletion AirshipContentExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="17.2.0"
AIRSHIP_VERSION="17.2.1"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
2 changes: 1 addition & 1 deletion AirshipDebug.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="17.2.0"
AIRSHIP_VERSION="17.2.1"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
2 changes: 1 addition & 1 deletion AirshipServiceExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="17.2.0"
AIRSHIP_VERSION="17.2.1"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

[Migration Guides](https://github.com/urbanairship/ios-library/tree/main/Documentation/Migration)

## Version 17.2.1 August 29, 2023
Patch release that fixes an issue with not being able to update a Live Activity after it becomes stale. Apps that use `staleDate` with Live Activities should update.

### Changes
- Continue to track a Live Activity after it becomes stale

## Version 17.2.0 August 25, 2023
Minor release that fixes a reporting issue with hold out groups and In-App Messaging. 17.2.0 will be the minimum version required for global hold out groups.

Expand Down

0 comments on commit a9ccfdc

Please sign in to comment.