Skip to content

Commit

Permalink
Release 11.2.0 (#74)
Browse files Browse the repository at this point in the history
* Release 11.2.0

* Fix
  • Loading branch information
rlepinski authored Dec 19, 2024
1 parent dfa0d6c commit 11b3b15
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 31 deletions.
4 changes: 2 additions & 2 deletions AirshipFrameworkProxy.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Pod::Spec.new do |s|
s.version = "11.1.0"
s.version = "11.2.0"
s.name = "AirshipFrameworkProxy"
s.summary = "Airship iOS mobile framework proxy"
s.documentation_url = "https://docs.airship.com/platform/mobile"
Expand All @@ -15,7 +15,7 @@ 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', "18.13.0"
s.dependency 'Airship', "18.14.0"
s.source_files = 'ios/AirshipFrameworkProxyLoader/**/*.{swift,h,m,c,cc,mm,cpp}', 'ios/AirshipFrameworkProxy/**/*.{swift,h,m,c,cc,mm,cpp}'
end

Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
)
],
dependencies: [
.package(url: "/~https://github.com/urbanairship/ios-library.git", from: "18.13.0")
.package(url: "/~https://github.com/urbanairship/ios-library.git", from: "18.14.0")
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,36 @@ package com.urbanairship.android.framework.proxy.proxies

import com.urbanairship.featureflag.FeatureFlag
import com.urbanairship.featureflag.FeatureFlagManager
import com.urbanairship.featureflag.FeatureFlagResultCache
import com.urbanairship.json.JsonSerializable
import com.urbanairship.json.JsonValue
import com.urbanairship.json.jsonMapOf
import com.urbanairship.json.requireField
import kotlin.time.Duration

public class FeatureFlagManagerProxy internal constructor(private val featureFlagManagerProvider: () -> FeatureFlagManager) {
public suspend fun flag(name: String): FeatureFlagProxy {
val flag = featureFlagManagerProvider().flag(name).getOrThrow()
public class FeatureFlagManagerProxy internal constructor(
private val featureFlagManagerProvider: () -> FeatureFlagManager
) {

public val resultCache: ResultCacheProxy = ResultCacheProxy { featureFlagManagerProvider().resultCache }

public class ResultCacheProxy internal constructor(private val cacheProvider: () -> FeatureFlagResultCache) {

public suspend fun cache(flag: FeatureFlagProxy, ttl: Duration) {
cacheProvider().cache(flag.original, ttl)
}

public suspend fun flag(name: String): FeatureFlagProxy? {
return cacheProvider().flag(name)?.let { FeatureFlagProxy(it) }
}

public suspend fun removeCachedFlag(name: String) {
return cacheProvider().removeCachedFlag(name)
}
}

public suspend fun flag(name: String, useResultCache: Boolean = true): FeatureFlagProxy {
val flag = featureFlagManagerProvider().flag(name, useResultCache).getOrThrow()
return FeatureFlagProxy(flag)
}

Expand Down
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 = '11.1.0'
airship = '18.5.0'
airshipProxy = '11.2.0'
airship = '18.6.0'

# Gradle plugins
androidGradlePlugin = '8.3.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,51 @@ import AirshipCore
import AirshipFeatureFlags
#endif

public class AirshipFeatureFlagManagerProxy {
private let featureFlagManagerProvider: () throws -> FeatureFlagManager
public final class AirshipFeatureFlagManagerProxy: Sendable {
public final class ResultCacheProxy: Sendable {
private let cacheProvider: @Sendable () throws -> FeatureFlagResultCache

init(cacheProvider: @Sendable @escaping () throws -> FeatureFlagResultCache) {
self.cacheProvider = cacheProvider
}

private var cache: FeatureFlagResultCache {
get throws { try cacheProvider() }
}

public func cache(flag: FeatureFlagProxy, ttl: TimeInterval) async throws {
try await self.cache.cache(flag: flag.original, ttl: ttl)
}

public func flag(name: String) async throws -> FeatureFlagProxy? {
guard let flag = try await self.cache.flag(name: name) else {
return nil
}
return FeatureFlagProxy(flag: flag)
}

public func removeCachedFlag(name: String) async throws {
try await self.cache.removeCachedFlag(name: name)
}
}

private let featureFlagManagerProvider: @Sendable () throws -> FeatureFlagManager

private var featureFlagManager: FeatureFlagManager {
get throws { try featureFlagManagerProvider() }
}

init(featureFlagManagerProvider: @escaping () throws -> FeatureFlagManager) {
init(featureFlagManagerProvider: @Sendable @escaping () throws -> FeatureFlagManager) {
self.featureFlagManagerProvider = featureFlagManagerProvider
self.resultCache = ResultCacheProxy {
return try featureFlagManagerProvider().resultCache
}
}

public func flag(name: String) async throws -> FeatureFlagProxy {
let flag = try await self.featureFlagManager.flag(name: name)
public let resultCache: ResultCacheProxy

public func flag(name: String, useResultCache: Bool = true) async throws -> FeatureFlagProxy {
let flag = try await self.featureFlagManager.flag(name: name, useResultCache: useResultCache)
return FeatureFlagProxy(flag: flag)
}

Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target 'AirshipFrameworkProxy' do
pod 'Airship', '18.13.0'
pod 'Airship', '18.14.0'
end

target 'AirshipFrameworkProxyTests' do
Expand Down
34 changes: 17 additions & 17 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
PODS:
- Airship (18.13.0):
- Airship/Automation (= 18.13.0)
- Airship/Basement (= 18.13.0)
- Airship/Core (= 18.13.0)
- Airship/FeatureFlags (= 18.13.0)
- Airship/MessageCenter (= 18.13.0)
- Airship/PreferenceCenter (= 18.13.0)
- Airship/Automation (18.13.0):
- Airship (18.14.0):
- Airship/Automation (= 18.14.0)
- Airship/Basement (= 18.14.0)
- Airship/Core (= 18.14.0)
- Airship/FeatureFlags (= 18.14.0)
- Airship/MessageCenter (= 18.14.0)
- Airship/PreferenceCenter (= 18.14.0)
- Airship/Automation (18.14.0):
- Airship/Core
- Airship/Basement (18.13.0)
- Airship/Core (18.13.0):
- Airship/Basement (18.14.0)
- Airship/Core (18.14.0):
- Airship/Basement
- Airship/FeatureFlags (18.13.0):
- Airship/FeatureFlags (18.14.0):
- Airship/Core
- Airship/MessageCenter (18.13.0):
- Airship/MessageCenter (18.14.0):
- Airship/Core
- Airship/PreferenceCenter (18.13.0):
- Airship/PreferenceCenter (18.14.0):
- Airship/Core

DEPENDENCIES:
- Airship (= 18.13.0)
- Airship (= 18.14.0)

SPEC REPOS:
trunk:
- Airship

SPEC CHECKSUMS:
Airship: bfe90d95c2b2bd0ea9ed5248a1337f124fe8abfe
Airship: 9667bffd8c715811e51c9d57e0fb5161bbb45533

PODFILE CHECKSUM: f291ba6a8df67d15c53a5aa482d548d4b724e3e9
PODFILE CHECKSUM: 1eea5e69b4e0a1593adfeefecb198172841000f8

COCOAPODS: 1.16.2
COCOAPODS: 1.15.2

0 comments on commit 11b3b15

Please sign in to comment.