Skip to content

Commit

Permalink
Release 18.7.0 (#3167)
Browse files Browse the repository at this point in the history
* Release 18.6.1

* Updates

* Release 18.7.0
  • Loading branch information
rlepinski committed Jul 30, 2024
1 parent c6603d8 commit 87e5260
Show file tree
Hide file tree
Showing 18 changed files with 1,296 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Airship.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="18.6.0"
AIRSHIP_VERSION="18.7.0"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ struct InAppRemoteData: Sendable {
remoteDataInfo: payload.remoteDataInfo
)
} catch {
AirshipLogger.error("Failed to parse app remote-data response.")
AirshipLogger.error("Failed to parse app remote-data response. \(error)")
}

return nil
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 = 18.6.0
CURRENT_PROJECT_VERSION = 18.7.0

// Uncomment to include the preview build warning
// OTHER_CFLAGS = $(inherited) -DUA_PREVIEW=1
4 changes: 2 additions & 2 deletions Airship/AirshipCore/Source/AirshipJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Foundation
* Airship JSON.
*/
public enum AirshipJSON: Codable, Equatable, Sendable, Hashable {
public static let defaultEncoder = JSONEncoder()
public static let defaultDecoder = JSONDecoder()
public static var defaultEncoder: JSONEncoder { return JSONEncoder() }
public static var defaultDecoder: JSONDecoder { return JSONDecoder() }

case string(String)
case number(Double)
Expand Down
2 changes: 1 addition & 1 deletion Airship/AirshipCore/Source/AirshipVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Foundation

public struct AirshipVersion {
public static let version = "18.6.0"
public static let version = "18.7.0"
public static func get() -> String {
return version
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ final class ChannelBulkUpdateAPIClient: ChannelBulkUpdateAPIClientProtocol {

private let config: RuntimeConfig
private let session: AirshipRequestSession
private let encoder: JSONEncoder = JSONEncoder()

init(config: RuntimeConfig, session: AirshipRequestSession) {
self.config = config
Expand All @@ -35,6 +34,7 @@ final class ChannelBulkUpdateAPIClient: ChannelBulkUpdateAPIClientProtocol {
let url = try makeURL(channelID: channelID)
let payload = update.clientPayload

let encoder = JSONEncoder()
let data = try encoder.encode(payload)

AirshipLogger.debug(
Expand Down
4 changes: 2 additions & 2 deletions Airship/AirshipCore/Source/CustomEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public class CustomEvent: NSObject {

private var _eventValue: NSDecimalNumber?

public static let defaultEncoder: JSONEncoder = {
public static var defaultEncoder: JSONEncoder {
let encoder = JSONEncoder()
encoder.dateEncodingStrategy = .iso8601
return encoder
}()
}


/// The in-app message context for custom event attribution
Expand Down
3 changes: 1 addition & 2 deletions Airship/AirshipCore/Source/DeferredAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ final class DeferredAPIClient: DeferredAPIClientProtocol {
],
method: "POST",
auth: .channelAuthToken(identifier: channelID),
body: try self.encoder.encode(body)
body: try JSONEncoder().encode(body)
)

AirshipLogger.trace("Resolving deferred with request \(request) body \(body)")
Expand All @@ -69,7 +69,6 @@ final class DeferredAPIClient: DeferredAPIClientProtocol {

private let config: RuntimeConfig
private let session: AirshipRequestSession
private let encoder: JSONEncoder = JSONEncoder()

init(config: RuntimeConfig, session: AirshipRequestSession) {
self.config = config
Expand Down
1 change: 0 additions & 1 deletion Airship/AirshipCore/Source/EventAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ protocol EventAPIClientProtocol: Sendable {
final class EventAPIClient: EventAPIClientProtocol {
private let config: RuntimeConfig
private let session: AirshipRequestSession
private let encoder: JSONEncoder = JSONEncoder()

init(config: RuntimeConfig, session: AirshipRequestSession) {
self.config = config
Expand Down
11 changes: 0 additions & 11 deletions Airship/AirshipCore/Source/Media.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@ struct Media: View {
@Environment(\.pageIndex) var pageIndex


private var contentMode: ContentMode {
var contentMode = ContentMode.fill

/// Fit container if undefined size on x and y axes, otherwise fill and crop content on major axis to maintain aspect ratio
if self.model.mediaFit == .centerInside && Self.isUnbounded(constraints) {
contentMode = ContentMode.fit
}

return contentMode
}

fileprivate static func isUnbounded(_ constraints: ViewConstraints) -> Bool {
if constraints.width != nil && constraints.height != nil {
return false
Expand Down
2 changes: 1 addition & 1 deletion Airship/AirshipCore/Source/MediaWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct MediaWebView: UIViewRepresentable {
"bottom"
}

return "object-fit: cover; object-position: \(horizontal) \(vertical)"
return "width: 100vw; height: 100vh; object-fit: cover; object-position: \(horizontal) \(vertical)"
case .centerCrop:
return "object-fit: cover"
}
Expand Down
4 changes: 2 additions & 2 deletions Airship/AirshipCore/Source/MeteredUsageAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class MeteredUsageAPIClient : MeteredUsageAPIClientProtocol {
private let config: RuntimeConfig
private let session: AirshipRequestSession

private let encoder: JSONEncoder = {
private var encoder: JSONEncoder {
let encoder = JSONEncoder()
encoder.dateEncodingStrategy = .custom({ date, encoder in
var container = encoder.singleValueContainer()
Expand All @@ -23,7 +23,7 @@ final class MeteredUsageAPIClient : MeteredUsageAPIClientProtocol {
)
})
return encoder
}()
}


init(config: RuntimeConfig, session: AirshipRequestSession) {
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="18.6.0"
AIRSHIP_VERSION="18.7.0"

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="18.6.0"
AIRSHIP_VERSION="18.7.0"

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="18.6.0"
AIRSHIP_VERSION="18.7.0"

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

# iOS Changelog

## Version 18.7.0 July 30, 2024
Minor release that fixes some layout issues with images and videos in a Scene, accessibility improvements, and fixes a potential crash with JSON encoding/decoding due
to using a JSONEncoder/JSONDecoder across threads.

### Changes
- Fixed video & image scaling/cropping in scenes.
- Removed reusing JSONEncoder/JSONDecoder across tasks.
- Removed @MainActor requirement from AirshipPush.authorizedNotificationSettings.
- Announce screen changes when banners In-App messages are displayed.
- `MessageCenterController` is now optional when creating a `MessageCenterView`.

## Version 18.6.0 July 12, 2024
Minor release with some improvements to preference center, a fix for in-app message veritcal sizing, accessibility improvements and markdown support in scenes.

Expand Down
Loading

0 comments on commit 87e5260

Please sign in to comment.