Skip to content

Commit

Permalink
Merge branch 'upgrade_firebase_dependency'
Browse files Browse the repository at this point in the history
  • Loading branch information
sgr-ksmt committed Jul 3, 2019
2 parents 63e6fd1 + 46a55ee commit a325e96
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 163 deletions.
2 changes: 0 additions & 2 deletions Demo/Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,11 @@
"${PODS_ROOT}/Target Support Files/Pods-Demo/Pods-Demo-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
"${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down
108 changes: 35 additions & 73 deletions Demo/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,67 +1,35 @@
PODS:
- Firebase/Core (5.8.0):
- Firebase/CoreOnly (6.3.0):
- FirebaseCore (= 6.0.3)
- Firebase/RemoteConfig (6.3.0):
- Firebase/CoreOnly
- FirebaseAnalytics (= 5.1.2)
- Firebase/CoreOnly (5.8.0):
- FirebaseCore (= 5.1.3)
- Firebase/RemoteConfig (5.8.0):
- Firebase/Core
- FirebaseRemoteConfig (= 3.0.1)
- FirebaseABTesting (2.0.0):
- FirebaseCore (~> 5.0)
- FirebaseRemoteConfig (~> 4.1.0)
- FirebaseABTesting (3.0.0):
- FirebaseCore (~> 6.0)
- Protobuf (~> 3.5)
- FirebaseAnalytics (5.1.2):
- FirebaseCore (~> 5.1)
- FirebaseInstanceID (~> 3.2)
- GoogleAppMeasurement (~> 5.1)
- GoogleUtilities/AppDelegateSwizzler (~> 5.2.0)
- GoogleUtilities/MethodSwizzler (~> 5.2.0)
- GoogleUtilities/Network (~> 5.2)
- "GoogleUtilities/NSData+zlib (~> 5.2)"
- nanopb (~> 0.3)
- FirebaseCore (5.1.3):
- GoogleUtilities/Logger (~> 5.2)
- FirebaseInstanceID (3.2.1):
- FirebaseCore (~> 5.1)
- GoogleUtilities/Environment (~> 5.2)
- FirebaseRemoteConfig (3.0.1):
- FirebaseABTesting (~> 2.0)
- FirebaseAnalytics (~> 5.1)
- FirebaseCore (~> 5.1)
- FirebaseInstanceID (~> 3.2)
- GoogleUtilities/Environment (~> 5.2)
- "GoogleUtilities/NSData+zlib (~> 5.2)"
- FirebaseCore (6.0.3):
- GoogleUtilities/Environment (~> 6.0)
- GoogleUtilities/Logger (~> 6.0)
- FirebaseInstanceID (4.2.0):
- FirebaseCore (~> 6.0)
- GoogleUtilities/Environment (~> 6.0)
- GoogleUtilities/UserDefaults (~> 6.0)
- FirebaseRemoteConfig (4.1.0):
- FirebaseABTesting (~> 3.0)
- FirebaseCore (~> 6.0)
- FirebaseInstanceID (~> 4.2)
- GoogleUtilities/Environment (~> 6.0)
- "GoogleUtilities/NSData+zlib (~> 6.0)"
- Protobuf (~> 3.5)
- GoogleAppMeasurement (5.1.2):
- GoogleUtilities/AppDelegateSwizzler (~> 5.2.0)
- GoogleUtilities/MethodSwizzler (~> 5.2.0)
- GoogleUtilities/Network (~> 5.2)
- "GoogleUtilities/NSData+zlib (~> 5.2)"
- nanopb (~> 0.3)
- GoogleUtilities/AppDelegateSwizzler (5.2.3):
- GoogleUtilities/Environment (6.2.1)
- GoogleUtilities/Logger (6.2.1):
- GoogleUtilities/Environment
- "GoogleUtilities/NSData+zlib (6.2.1)"
- GoogleUtilities/UserDefaults (6.2.1):
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (5.2.3)
- GoogleUtilities/Logger (5.2.3):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (5.2.3):
- GoogleUtilities/Logger
- GoogleUtilities/Network (5.2.3):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (5.2.3)"
- GoogleUtilities/Reachability (5.2.3):
- GoogleUtilities/Logger
- Lobster (2.0):
- Firebase/RemoteConfig (~> 5.0)
- nanopb (0.3.8):
- nanopb/decode (= 0.3.8)
- nanopb/encode (= 0.3.8)
- nanopb/decode (0.3.8)
- nanopb/encode (0.3.8)
- Protobuf (3.6.1)
- Lobster (2.2):
- Firebase/RemoteConfig (~> 6.0)
- Protobuf (3.8.0)

DEPENDENCIES:
- Lobster (from `../`)
Expand All @@ -70,32 +38,26 @@ SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Firebase
- FirebaseABTesting
- FirebaseAnalytics
- FirebaseCore
- FirebaseInstanceID
- FirebaseRemoteConfig
- GoogleAppMeasurement
- GoogleUtilities
- nanopb
- Protobuf

EXTERNAL SOURCES:
Lobster:
:path: "../"

SPEC CHECKSUMS:
Firebase: 25812f43e7a53b11ae2f0a5f4c6d12faeb1f7cd7
FirebaseABTesting: 1f50b8d50f5e3469eea54e7463a7b7fe221d1f5e
FirebaseAnalytics: df15839e9c6ca6bd14d2e8ab6b0c672e6c49097e
FirebaseCore: 27bd80e5bfaaf9552a1f5cacb4c7e8bb925bab22
FirebaseInstanceID: ea5af6920d0a4a29b40459d055bebe4a6c1333c4
FirebaseRemoteConfig: 7b6d675dfb11f0e0e638caee00908b06af150d56
GoogleAppMeasurement: fc4a4c3fe0144db9313cbf443ffe62e6b1d6268c
GoogleUtilities: 6f681e27050c5e130325e89fa0316dfca826f954
Lobster: fd1c1322233a5de3a9c2aa33124e65d37e04d657
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
Protobuf: 1eb9700044745f00181c136ef21b8ff3ad5a0fd5
Firebase: 8432d732974498afd5987e9001a05f90f1a3d625
FirebaseABTesting: a32c488eb75089a61eb3d86db061dfb909d765db
FirebaseCore: 68f8a7f50cdae542715d4e86afa37c4067217dcb
FirebaseInstanceID: f20243a1d828e0e9a3798b995174dedc16f1b32a
FirebaseRemoteConfig: 7c64ecec5ca63d7c6b304509c3a6f9a036d403d4
GoogleUtilities: c7a0b08bda3bf808be823ed151f0e28ac6866e71
Lobster: b7c48cf6ff48e80f269715ce80cdc3e087c7b501
Protobuf: 3f617b9a6e73605565086864c9bc26b2bf2dd5a3

PODFILE CHECKSUM: c6efd56fba58da5968399c93e6f38bb7f1692d81

COCOAPODS: 1.6.1
COCOAPODS: 1.7.2
4 changes: 2 additions & 2 deletions Lobster.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Lobster"
s.version = "2.1"
s.version = "2.2"
s.summary = "Type-safe Firebase-RemoteConfig helper library"
s.homepage = "https://github.com/sgr-ksmt/Lobster"
s.license = 'MIT'
Expand All @@ -11,5 +11,5 @@ Pod::Spec.new do |s|
s.source_files = "Sources/**/*"
s.static_framework = true
s.swift_version = '5.0'
s.dependency "Firebase/RemoteConfig", "~> 5.0"
s.dependency "Firebase/RemoteConfig", "~> 6.0"
end
1 change: 1 addition & 0 deletions Lobster.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 163143F51FA8BE8600D25996;
productRefGroup = 163144001FA8BE8600D25996 /* Products */;
Expand Down
2 changes: 1 addition & 1 deletion Lobster.xcodeproj/xcshareddata/xcschemes/Lobster.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inhibit_all_warnings!
use_frameworks!

target 'Lobster' do
pod 'Firebase/RemoteConfig', '~> 5.0'
pod 'Firebase/RemoteConfig', '~> 6.0'
target 'LobsterTests' do
inherit! :search_paths
end
Expand Down
107 changes: 33 additions & 74 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,97 +1,56 @@
PODS:
- Firebase/Core (5.18.0):
- Firebase/CoreOnly (6.3.0):
- FirebaseCore (= 6.0.3)
- Firebase/RemoteConfig (6.3.0):
- Firebase/CoreOnly
- FirebaseAnalytics (= 5.7.0)
- Firebase/CoreOnly (5.18.0):
- FirebaseCore (= 5.3.1)
- Firebase/RemoteConfig (5.18.0):
- Firebase/Core
- FirebaseRemoteConfig (= 3.1.0)
- FirebaseABTesting (2.0.0):
- FirebaseCore (~> 5.0)
- FirebaseRemoteConfig (~> 4.1.0)
- FirebaseABTesting (3.0.0):
- FirebaseCore (~> 6.0)
- Protobuf (~> 3.5)
- FirebaseAnalytics (5.7.0):
- FirebaseCore (~> 5.3)
- FirebaseInstanceID (~> 3.6)
- GoogleAppMeasurement (= 5.7.0)
- GoogleUtilities/AppDelegateSwizzler (~> 5.2)
- GoogleUtilities/MethodSwizzler (~> 5.2)
- GoogleUtilities/Network (~> 5.2)
- "GoogleUtilities/NSData+zlib (~> 5.2)"
- nanopb (~> 0.3)
- FirebaseCore (5.3.1):
- GoogleUtilities/Logger (~> 5.2)
- FirebaseInstanceID (3.7.0):
- FirebaseCore (~> 5.2)
- GoogleUtilities/Environment (~> 5.2)
- GoogleUtilities/UserDefaults (~> 5.2)
- FirebaseRemoteConfig (3.1.0):
- FirebaseABTesting (~> 2.0)
- FirebaseAnalytics (~> 5.3)
- FirebaseCore (~> 5.1)
- FirebaseInstanceID (~> 3.3)
- GoogleUtilities/Environment (~> 5.2)
- "GoogleUtilities/NSData+zlib (~> 5.2)"
- FirebaseCore (6.0.3):
- GoogleUtilities/Environment (~> 6.0)
- GoogleUtilities/Logger (~> 6.0)
- FirebaseInstanceID (4.2.0):
- FirebaseCore (~> 6.0)
- GoogleUtilities/Environment (~> 6.0)
- GoogleUtilities/UserDefaults (~> 6.0)
- FirebaseRemoteConfig (4.1.0):
- FirebaseABTesting (~> 3.0)
- FirebaseCore (~> 6.0)
- FirebaseInstanceID (~> 4.2)
- GoogleUtilities/Environment (~> 6.0)
- "GoogleUtilities/NSData+zlib (~> 6.0)"
- Protobuf (~> 3.5)
- GoogleAppMeasurement (5.7.0):
- GoogleUtilities/AppDelegateSwizzler (~> 5.2)
- GoogleUtilities/MethodSwizzler (~> 5.2)
- GoogleUtilities/Network (~> 5.2)
- "GoogleUtilities/NSData+zlib (~> 5.2)"
- nanopb (~> 0.3)
- GoogleUtilities/AppDelegateSwizzler (5.5.0):
- GoogleUtilities/Environment (6.2.1)
- GoogleUtilities/Logger (6.2.1):
- GoogleUtilities/Environment
- "GoogleUtilities/NSData+zlib (6.2.1)"
- GoogleUtilities/UserDefaults (6.2.1):
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (5.5.0)
- GoogleUtilities/Logger (5.5.0):
- GoogleUtilities/Environment
- GoogleUtilities/MethodSwizzler (5.5.0):
- GoogleUtilities/Logger
- GoogleUtilities/Network (5.5.0):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (5.5.0)"
- GoogleUtilities/Reachability (5.5.0):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (5.5.0):
- GoogleUtilities/Logger
- nanopb (0.3.901):
- nanopb/decode (= 0.3.901)
- nanopb/encode (= 0.3.901)
- nanopb/decode (0.3.901)
- nanopb/encode (0.3.901)
- Protobuf (3.7.0)
- Protobuf (3.8.0)

DEPENDENCIES:
- Firebase/RemoteConfig (~> 5.0)
- Firebase/RemoteConfig (~> 6.0)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Firebase
- FirebaseABTesting
- FirebaseAnalytics
- FirebaseCore
- FirebaseInstanceID
- FirebaseRemoteConfig
- GoogleAppMeasurement
- GoogleUtilities
- nanopb
- Protobuf

SPEC CHECKSUMS:
Firebase: 02f3281965c075426141a0ce1277e9de6649cab9
FirebaseABTesting: 1f50b8d50f5e3469eea54e7463a7b7fe221d1f5e
FirebaseAnalytics: 23851fe602c872130a2c5c55040b302120346cc2
FirebaseCore: 52f851b30e11360f1e67cf04b1edfebf0a47a2d3
FirebaseInstanceID: bd6fc5a258884e206fd5c474ebe4f5b00e21770e
FirebaseRemoteConfig: 7e11c65f0769c09bff6947997c209515058c5318
GoogleAppMeasurement: 6cf307834da065863f9faf4c0de0a936d81dd832
GoogleUtilities: 6481e6318c5fcabaaa8513ef8120f329055d7c10
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
Protobuf: 7a877b7f3e5964e3fce995e2eb323dbc6831bb5a
Firebase: 8432d732974498afd5987e9001a05f90f1a3d625
FirebaseABTesting: a32c488eb75089a61eb3d86db061dfb909d765db
FirebaseCore: 68f8a7f50cdae542715d4e86afa37c4067217dcb
FirebaseInstanceID: f20243a1d828e0e9a3798b995174dedc16f1b32a
FirebaseRemoteConfig: 7c64ecec5ca63d7c6b304509c3a6f9a036d403d4
GoogleUtilities: c7a0b08bda3bf808be823ed151f0e28ac6866e71
Protobuf: 3f617b9a6e73605565086864c9bc26b2bf2dd5a3

PODFILE CHECKSUM: 6434246e86875f87cb87a53d5f214d06ff00ef26
PODFILE CHECKSUM: 36c0843f8e15305700f7260d1eadafe9175ca89d

COCOAPODS: 1.6.1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ $ open Demo.xcworkspace
## Requirements
- iOS 11.0+
- Xcode 10+
- Swift 4.2
- Swift 5.0

## Installation
### CocoaPods
**Lobster** is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'Lobster', '~> 2.1'
pod 'Lobster', '~> 2.2'
```

and run `pod install`
Expand Down
20 changes: 12 additions & 8 deletions Sources/Lobster.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ public class Lobster {
/// Returns FIRRemoteConfig instance.
public let remoteConfig = RemoteConfig.remoteConfig()

/// Default expiration duration. (12 hours)
public static let defaultExpirationDuration: TimeInterval = 43_200.0

/// Expiration duration for cache. Default duration is 12 hours
public var fetchExpirationDuration: TimeInterval = 43_200.0
public var fetchExpirationDuration: TimeInterval = Lobster.defaultExpirationDuration

/// The flag whether to do stale check. Default is `true`.
public var useStaleChecker: Bool = true
Expand All @@ -41,7 +44,7 @@ public class Lobster {
/// NOTE: It must be false on production.
public var debugMode: Bool = false {
didSet {
remoteConfig.configSettings = RemoteConfigSettings(developerModeEnabled: debugMode)
remoteConfig.configSettings.minimumFetchInterval = debugMode ? 0 : Lobster.defaultExpirationDuration
}
}
public private(set) var fetchStatus: RemoteConfigFetchStatus = .noFetchYet
Expand All @@ -57,13 +60,14 @@ public class Lobster {
public func fetch(completion: @escaping (Error?) -> Void = { _ in }) {
let duration = getExpirationDuration()
remoteConfig.fetch(withExpirationDuration: duration) { [unowned self] (status, error) in
if error == nil {
RemoteConfig.remoteConfig().activateFetched()
var fetchError: Error? = error
RemoteConfig.remoteConfig().activate { (error) in
fetchError = error ?? fetchError
self.fetchStatus = status
self.isStaled = false
completion(fetchError)
NotificationCenter.default.post(name: Lobster.didFetchConfig, object: error)
}
self.fetchStatus = status
self.isStaled = false
completion(error)
NotificationCenter.default.post(name: Lobster.didFetchConfig, object: error)
}
}

Expand Down

0 comments on commit a325e96

Please sign in to comment.