Skip to content

Commit

Permalink
Release 6.0.0 (#38)
Browse files Browse the repository at this point in the history
* Release 6.0.0

# Conflicts:
#	AirshipFrameworkProxy.podspec
#	android/gradle/libs.versions.toml
#	ios/Podfile

* Update runner

* Runner

* Xcode version

* Fix warning

* Add back parse/names until 18.1.1
  • Loading branch information
rlepinski authored Apr 17, 2024
1 parent bf31534 commit dd7fda8
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 176 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request]

env:
BUNDLE_PATH: vendor/bundle
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.3.app/Contents/Developer

concurrency:
group: ${{ github.ref }}
Expand All @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: set up JDK 11
uses: actions/setup-java@v2
Expand All @@ -42,10 +42,10 @@ jobs:
fail_on_failure: true

ios:
runs-on: macOS-13-xl
runs-on: macos-14-xlarge
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Coreutils
run: brew install coreutils
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:

env:
BUNDLE_PATH: vendor/bundle
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.3.app/Contents/Developer

jobs:
android:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Get the version
id: get_version
Expand Down Expand Up @@ -50,11 +50,12 @@ jobs:
closeAndReleaseSonatypeStagingRepository
ios:
runs-on: macOS-13-xl
runs-on: macos-14-xlarge
timeout-minutes: 30
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v4


- name: Install Coreutils
run: brew install coreutils

Expand Down
5 changes: 2 additions & 3 deletions AirshipFrameworkProxy.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Pod::Spec.new do |s|
s.version = "5.4.2"
s.version = "6.0.0"
s.name = "AirshipFrameworkProxy"
s.summary = "Airship iOS mobile framework proxy"
s.documentation_url = "https://docs.airship.com/platform/mobile"
Expand All @@ -15,6 +15,5 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.swift_version = "5.0"
s.source_files = "ios/AirshipFrameworkProxy/**/*.{h,m,swift}"
s.dependency 'Airship', "17.9.1"

s.dependency 'Airship', "18.1.0"
end
4 changes: 2 additions & 2 deletions android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[versions]

# Airship
airshipProxy = '5.4.2'
airship = '17.7.4'
airshipProxy = '6.0.0'
airship = '17.8.0'

# Gradle plugins
androidGradlePlugin = '7.3.0'
Expand Down
18 changes: 2 additions & 16 deletions ios/AirshipFrameworkProxy/AirshipExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extension UAAuthorizedNotificationSettings {
}
}

extension AirshipFeature: Codable {
extension AirshipFeature {
static let nameMap: [String: AirshipFeature] = [
"push": .push,
"contacts": .contacts,
Expand All @@ -63,6 +63,7 @@ extension AirshipFeature: Codable {
"all": .all,
"none": []
]


var names: [String] {
var names: [String] = []
Expand Down Expand Up @@ -105,21 +106,6 @@ extension AirshipFeature: Codable {

return features
}

public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
try container.encode(self.names)
}

public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()

if let names: [String] = try? container.decode([String].self) {
self = try AirshipFeature.parse(names)
} else {
throw AirshipErrors.error("Failed to parse features")
}
}
}

extension UANotificationOptions {
Expand Down
34 changes: 17 additions & 17 deletions ios/AirshipFrameworkProxy/DefaultMessageCenterUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import SwiftUI

public class DefaultMessageCenterUI {
static let shared: DefaultMessageCenterUI = DefaultMessageCenterUI()
private var currentDisplay: Disposable?
private var currentDisplay: AirshipMainActorCancellable?
private var controller: MessageCenterController = MessageCenterController()

@MainActor
func dismiss() {
self.currentDisplay?.dispose()
self.currentDisplay?.cancel()
}

@MainActor
func display(messageID: String? = nil) {
guard let scene = try? AirshipUtils.findWindowScene() else {
guard let scene = try? AirshipSceneManager.shared.lastActiveScene else {
AirshipLogger.error(
"Unable to display message center, missing scene."
)
Expand All @@ -24,7 +24,7 @@ public class DefaultMessageCenterUI {

controller.navigate(messageID: messageID)

currentDisplay?.dispose()
currentDisplay?.cancel()

AirshipLogger.debug("Opening default message center UI")

Expand All @@ -36,15 +36,15 @@ public class DefaultMessageCenterUI {

@MainActor
func displayMessageView(messageID: String) {
guard let scene = try? AirshipUtils.findWindowScene() else {
guard let scene = try? AirshipSceneManager.shared.lastActiveScene else {
AirshipLogger.error(
"Unable to display message center, missing scene."
)
return
}

currentDisplay?.dispose()
currentDisplay?.cancel()

self.currentDisplay = openMessageView(
scene: scene,
messageID: messageID,
Expand All @@ -56,10 +56,10 @@ public class DefaultMessageCenterUI {
private func open(
scene: UIWindowScene,
theme: MessageCenterTheme?
) -> Disposable {
) -> AirshipMainActorCancellable {
var window: UIWindow? = UIWindow(windowScene: scene)

let disposable = Disposable {
let cancellable = AirshipMainActorCancellableBlock {
window?.windowLevel = .normal
window?.isHidden = true
window = nil
Expand All @@ -69,26 +69,26 @@ public class DefaultMessageCenterUI {
theme: theme,
controller: self.controller
) {
disposable.dispose()
cancellable.cancel()
}

window?.isHidden = false
window?.windowLevel = .alert
window?.makeKeyAndVisible()
window?.rootViewController = viewController

return disposable
return cancellable
}

@MainActor
private func openMessageView(
scene: UIWindowScene,
messageID: String,
theme: MessageCenterTheme?
) -> Disposable {
) -> AirshipMainActorCancellable {
var window: UIWindow? = UIWindow(windowScene: scene)

let disposable = Disposable {
let cancellable = AirshipMainActorCancellableBlock {
window?.windowLevel = .normal
window?.isHidden = true
window = nil
Expand All @@ -98,15 +98,15 @@ public class DefaultMessageCenterUI {
let viewController = HostingViewController(
rootView: StandaloneMessageView(
dismissAction: {
disposable.dispose()
cancellable.cancel()

},
content: {
MessageCenterMessageView(
messageID: messageID,
title: nil
) {
disposable.dispose()
cancellable.cancel()
}
.messageCenterTheme(theme)
}
Expand All @@ -119,7 +119,7 @@ public class DefaultMessageCenterUI {
window?.makeKeyAndVisible()
window?.rootViewController = viewController

return disposable
return cancellable
}
}

Expand Down Expand Up @@ -187,7 +187,7 @@ struct StandaloneMessageView<Content: View>: View {

extension String {
var airshipLocalizedString: String {
return LocalizationUtils.localizedString(
return AirshipLocalizationUtils.localizedString(
self,
withTable: "UrbanAirship",
moduleBundle: AirshipCoreResources.bundle
Expand Down
27 changes: 4 additions & 23 deletions ios/AirshipFrameworkProxy/Proxies/AirshipAnalyticsProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ public class AirshipAnalyticsProxy {
throw AirshipErrors.error("Invalid event: \(event)")
}

try analytics.addCustomEvent(event: customEvent)
try analytics.recordCustomEvent(customEvent)
}

@MainActor
public func trackScreen(_ screen: String?) throws {
try self.analytics.trackScreen(screen)
}
Expand All @@ -63,29 +64,9 @@ public class AirshipAnalyticsProxy {
identifier: String?,
key: String
) throws {
try self.analytics.associateIdentifier(
identifier: identifier,
key: key
)
}

}

protocol AirshipAnalyticsProtocol: AnyObject {
func trackScreen(_ screen: String?)
func associateIdentifier(identifier: String?, key: String)
func addCustomEvent(event: CustomEvent)
}

extension AirshipAnalytics: AirshipAnalyticsProtocol {
func associateIdentifier(identifier: String?, key: String) {
let identifiers = self.currentAssociatedDeviceIdentifiers()
let identifiers = try self.analytics.currentAssociatedDeviceIdentifiers()
identifiers.set(identifier: identifier, key: key)
self.associateDeviceIdentifiers(identifiers)
}

func addCustomEvent(event: CustomEvent) {
self.addEvent(event)
try self.analytics.associateDeviceIdentifiers(identifiers)
}

}
8 changes: 4 additions & 4 deletions ios/AirshipFrameworkProxy/Proxies/AirshipChannelProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class AirshipChannelProxy {

@objc
public func editTags(json: Any) throws {
let data = try JSONUtils.data(json)
let data = try AirshipJSONUtils.data(json)
let operations = try JSONDecoder().decode(
[TagOperation].self,
from: data
Expand Down Expand Up @@ -61,7 +61,7 @@ public class AirshipChannelProxy {

@objc
public func editTagGroups(json: Any) throws {
let data = try JSONUtils.data(json)
let data = try AirshipJSONUtils.data(json)
let operations = try JSONDecoder().decode(
[TagGroupOperation].self,
from: data
Expand All @@ -78,7 +78,7 @@ public class AirshipChannelProxy {
}

public func editAttributes(json: Any) throws {
let data = try JSONUtils.data(json)
let data = try AirshipJSONUtils.data(json)
let operations = try JSONDecoder().decode(
[AttributeOperation].self,
from: data
Expand All @@ -96,7 +96,7 @@ public class AirshipChannelProxy {
}

public func editSubscriptionLists(json: Any) throws {
let data = try JSONUtils.data(json)
let data = try AirshipJSONUtils.data(json)
let operations = try JSONDecoder().decode(
[SubscriptionListOperation].self,
from: data
Expand Down
6 changes: 3 additions & 3 deletions ios/AirshipFrameworkProxy/Proxies/AirshipContactProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class AirshipContactProxy {
}

public func editTagGroups(json: Any) throws {
let data = try JSONUtils.data(json)
let data = try AirshipJSONUtils.data(json)
let operations = try JSONDecoder().decode(
[TagGroupOperation].self,
from: data
Expand All @@ -71,7 +71,7 @@ public class AirshipContactProxy {

@objc
public func editAttributes(json: Any) throws {
let data = try JSONUtils.data(json)
let data = try AirshipJSONUtils.data(json)
let operations = try JSONDecoder().decode(
[AttributeOperation].self,
from: data
Expand All @@ -89,7 +89,7 @@ public class AirshipContactProxy {
}

public func editSubscriptionLists(json: Any) throws {
let data = try JSONUtils.data(json)
let data = try AirshipJSONUtils.data(json)
let operations = try JSONDecoder().decode(
[ScopedSubscriptionListOperation].self,
from: data
Expand Down
Loading

0 comments on commit dd7fda8

Please sign in to comment.