Skip to content

Commit

Permalink
Merge pull request #61 from shimastripe/firebase/v11
Browse files Browse the repository at this point in the history
Support 11.0.0
  • Loading branch information
fumito-ito authored Jul 31, 2024
2 parents c97cddd + 5bb30da commit 2ec8a67
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
6 changes: 3 additions & 3 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" ~> 10.0.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseProtobufBinary.json" ~> 10.0.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" ~> 10.0.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" ~> 11.0.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseProtobufBinary.json" ~> 11.0.0
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" ~> 11.0.0
10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import PackageDescription
let package = Package(
name: "SwiftyRemoteConfig",
platforms: [
.iOS(.v11),
.macOS(.v10_13),
.tvOS(.v12),
.watchOS(.v6),
.iOS(.v12),
.macOS(.v10_15),
.tvOS(.v13),
.watchOS(.v7),
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
Expand All @@ -21,7 +21,7 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/firebase/firebase-ios-sdk.git",
.upToNextMajor(from: "10.29.0")
.upToNextMajor(from: "11.0.0")
),
],
targets: [
Expand Down
14 changes: 7 additions & 7 deletions Sources/SwiftyRemoteConfig/RemoteConfigBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public struct RemoteConfigStringBridge: RemoteConfigBridge {
public func get(key: String, remoteConfig: RemoteConfig) -> String? {
let configValue = remoteConfig.configValue(forKey: key)

if configValue.stringValue?.isEmpty == true || configValue.stringValue.isNil {
if configValue.stringValue.isEmpty == true {
return nil
}

Expand All @@ -64,7 +64,7 @@ public struct RemoteConfigIntBridge: RemoteConfigBridge {
public func get(key: String, remoteConfig: RemoteConfig) -> Int? {
let configValue = remoteConfig.configValue(forKey: key)

if configValue.stringValue?.isEmpty == true || configValue.stringValue.isNil {
if configValue.stringValue.isEmpty == true {
return nil
}

Expand All @@ -82,7 +82,7 @@ public struct RemoteConfigDoubleBridge: RemoteConfigBridge {
public func get(key: String, remoteConfig: RemoteConfig) -> Double? {
let configValue = remoteConfig.configValue(forKey: key)

if configValue.stringValue?.isEmpty == true || configValue.stringValue.isNil {
if configValue.stringValue.isEmpty == true {
return nil
}

Expand All @@ -100,7 +100,7 @@ public struct RemoteConfigBoolBridge: RemoteConfigBridge {
public func get(key: String, remoteConfig: RemoteConfig) -> Bool? {
let configValue = remoteConfig.configValue(forKey: key)

if configValue.stringValue?.isEmpty == true || configValue.stringValue.isNil {
if configValue.stringValue.isEmpty == true {
return nil
}

Expand Down Expand Up @@ -133,12 +133,12 @@ public struct RemoteConfigUrlBridge: RemoteConfigBridge {
}

public func deserialize(_ object: RemoteConfigValue) -> URL? {
if let stringValue = object.stringValue, stringValue.isEmpty == false {
if let url = URL(string: stringValue) {
if object.stringValue.isEmpty == false {
if let url = URL(string: object.stringValue) {
return url
}

let path = (stringValue as NSString).expandingTildeInPath
let path = (object.stringValue as NSString).expandingTildeInPath
return URL(fileURLWithPath: path)
}

Expand Down
10 changes: 5 additions & 5 deletions SwiftyRemoteConfig.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ Pod::Spec.new do |spec|
spec.authors = { "Fumito Ito" => "[email protected]" }
spec.social_media_url = "https://twitter.com/fumito_ito"

spec.ios.deployment_target = "11.0"
spec.osx.deployment_target = "10.12"
spec.tvos.deployment_target = "12.0"
spec.watchos.deployment_target = "6.0"
spec.ios.deployment_target = "12.0"
spec.osx.deployment_target = "10.15"
spec.tvos.deployment_target = "13.0"
spec.watchos.deployment_target = "7.0"
spec.source = { :git => "https://github.com/fumito-ito/SwiftyRemoteConfig.git", :tag => "#{spec.version}" }
spec.source_files = "Sources", "Sources/**/*.swift"
spec.requires_arc = true
spec.swift_versions = "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6"

spec.static_framework = true
spec.dependency "FirebaseRemoteConfig", "~> 10.0.0"
spec.dependency "FirebaseRemoteConfig", "~> 11.0.0"

end
7 changes: 4 additions & 3 deletions Tests/SwiftyRemoteConfigTests/Helpers/TestHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,20 @@ struct FrogCustomSerializable: RemoteConfigSerializable, Equatable {

final class RemoteConfigFrogBridge: RemoteConfigBridge {
func get(key: String, remoteConfig: RemoteConfig) -> FrogCustomSerializable? {
guard let name = remoteConfig.configValue(forKey: key).stringValue, name.isEmpty == false else {
let name = remoteConfig.configValue(forKey: key).stringValue
guard name.isEmpty == false else {
return nil
}

return FrogCustomSerializable.init(name: name)
}

func deserialize(_ object: RemoteConfigValue) -> FrogCustomSerializable? {
guard let name = object.stringValue, name.isEmpty == false else {
guard object.stringValue.isEmpty == false else {
return nil
}

return FrogCustomSerializable.init(name: name)
return FrogCustomSerializable.init(name: object.stringValue)
}
}

Expand Down

0 comments on commit 2ec8a67

Please sign in to comment.