Skip to content

Commit a325e96

Browse files
author
sgr-ksmt
committed
Merge branch 'upgrade_firebase_dependency'
2 parents 63e6fd1 + 46a55ee commit a325e96

File tree

9 files changed

+87
-163
lines changed

9 files changed

+87
-163
lines changed

Demo/Demo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,11 @@
197197
"${PODS_ROOT}/Target Support Files/Pods-Demo/Pods-Demo-frameworks.sh",
198198
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
199199
"${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework",
200-
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
201200
);
202201
name = "[CP] Embed Pods Frameworks";
203202
outputPaths = (
204203
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
205204
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework",
206-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
207205
);
208206
runOnlyForDeploymentPostprocessing = 0;
209207
shellPath = /bin/sh;

Demo/Podfile.lock

Lines changed: 35 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,35 @@
11
PODS:
2-
- Firebase/Core (5.8.0):
2+
- Firebase/CoreOnly (6.3.0):
3+
- FirebaseCore (= 6.0.3)
4+
- Firebase/RemoteConfig (6.3.0):
35
- Firebase/CoreOnly
4-
- FirebaseAnalytics (= 5.1.2)
5-
- Firebase/CoreOnly (5.8.0):
6-
- FirebaseCore (= 5.1.3)
7-
- Firebase/RemoteConfig (5.8.0):
8-
- Firebase/Core
9-
- FirebaseRemoteConfig (= 3.0.1)
10-
- FirebaseABTesting (2.0.0):
11-
- FirebaseCore (~> 5.0)
6+
- FirebaseRemoteConfig (~> 4.1.0)
7+
- FirebaseABTesting (3.0.0):
8+
- FirebaseCore (~> 6.0)
129
- Protobuf (~> 3.5)
13-
- FirebaseAnalytics (5.1.2):
14-
- FirebaseCore (~> 5.1)
15-
- FirebaseInstanceID (~> 3.2)
16-
- GoogleAppMeasurement (~> 5.1)
17-
- GoogleUtilities/AppDelegateSwizzler (~> 5.2.0)
18-
- GoogleUtilities/MethodSwizzler (~> 5.2.0)
19-
- GoogleUtilities/Network (~> 5.2)
20-
- "GoogleUtilities/NSData+zlib (~> 5.2)"
21-
- nanopb (~> 0.3)
22-
- FirebaseCore (5.1.3):
23-
- GoogleUtilities/Logger (~> 5.2)
24-
- FirebaseInstanceID (3.2.1):
25-
- FirebaseCore (~> 5.1)
26-
- GoogleUtilities/Environment (~> 5.2)
27-
- FirebaseRemoteConfig (3.0.1):
28-
- FirebaseABTesting (~> 2.0)
29-
- FirebaseAnalytics (~> 5.1)
30-
- FirebaseCore (~> 5.1)
31-
- FirebaseInstanceID (~> 3.2)
32-
- GoogleUtilities/Environment (~> 5.2)
33-
- "GoogleUtilities/NSData+zlib (~> 5.2)"
10+
- FirebaseCore (6.0.3):
11+
- GoogleUtilities/Environment (~> 6.0)
12+
- GoogleUtilities/Logger (~> 6.0)
13+
- FirebaseInstanceID (4.2.0):
14+
- FirebaseCore (~> 6.0)
15+
- GoogleUtilities/Environment (~> 6.0)
16+
- GoogleUtilities/UserDefaults (~> 6.0)
17+
- FirebaseRemoteConfig (4.1.0):
18+
- FirebaseABTesting (~> 3.0)
19+
- FirebaseCore (~> 6.0)
20+
- FirebaseInstanceID (~> 4.2)
21+
- GoogleUtilities/Environment (~> 6.0)
22+
- "GoogleUtilities/NSData+zlib (~> 6.0)"
3423
- Protobuf (~> 3.5)
35-
- GoogleAppMeasurement (5.1.2):
36-
- GoogleUtilities/AppDelegateSwizzler (~> 5.2.0)
37-
- GoogleUtilities/MethodSwizzler (~> 5.2.0)
38-
- GoogleUtilities/Network (~> 5.2)
39-
- "GoogleUtilities/NSData+zlib (~> 5.2)"
40-
- nanopb (~> 0.3)
41-
- GoogleUtilities/AppDelegateSwizzler (5.2.3):
24+
- GoogleUtilities/Environment (6.2.1)
25+
- GoogleUtilities/Logger (6.2.1):
4226
- GoogleUtilities/Environment
27+
- "GoogleUtilities/NSData+zlib (6.2.1)"
28+
- GoogleUtilities/UserDefaults (6.2.1):
4329
- GoogleUtilities/Logger
44-
- GoogleUtilities/Network
45-
- GoogleUtilities/Environment (5.2.3)
46-
- GoogleUtilities/Logger (5.2.3):
47-
- GoogleUtilities/Environment
48-
- GoogleUtilities/MethodSwizzler (5.2.3):
49-
- GoogleUtilities/Logger
50-
- GoogleUtilities/Network (5.2.3):
51-
- GoogleUtilities/Logger
52-
- "GoogleUtilities/NSData+zlib"
53-
- GoogleUtilities/Reachability
54-
- "GoogleUtilities/NSData+zlib (5.2.3)"
55-
- GoogleUtilities/Reachability (5.2.3):
56-
- GoogleUtilities/Logger
57-
- Lobster (2.0):
58-
- Firebase/RemoteConfig (~> 5.0)
59-
- nanopb (0.3.8):
60-
- nanopb/decode (= 0.3.8)
61-
- nanopb/encode (= 0.3.8)
62-
- nanopb/decode (0.3.8)
63-
- nanopb/encode (0.3.8)
64-
- Protobuf (3.6.1)
30+
- Lobster (2.2):
31+
- Firebase/RemoteConfig (~> 6.0)
32+
- Protobuf (3.8.0)
6533

6634
DEPENDENCIES:
6735
- Lobster (from `../`)
@@ -70,32 +38,26 @@ SPEC REPOS:
7038
https://github.com/cocoapods/specs.git:
7139
- Firebase
7240
- FirebaseABTesting
73-
- FirebaseAnalytics
7441
- FirebaseCore
7542
- FirebaseInstanceID
7643
- FirebaseRemoteConfig
77-
- GoogleAppMeasurement
7844
- GoogleUtilities
79-
- nanopb
8045
- Protobuf
8146

8247
EXTERNAL SOURCES:
8348
Lobster:
8449
:path: "../"
8550

8651
SPEC CHECKSUMS:
87-
Firebase: 25812f43e7a53b11ae2f0a5f4c6d12faeb1f7cd7
88-
FirebaseABTesting: 1f50b8d50f5e3469eea54e7463a7b7fe221d1f5e
89-
FirebaseAnalytics: df15839e9c6ca6bd14d2e8ab6b0c672e6c49097e
90-
FirebaseCore: 27bd80e5bfaaf9552a1f5cacb4c7e8bb925bab22
91-
FirebaseInstanceID: ea5af6920d0a4a29b40459d055bebe4a6c1333c4
92-
FirebaseRemoteConfig: 7b6d675dfb11f0e0e638caee00908b06af150d56
93-
GoogleAppMeasurement: fc4a4c3fe0144db9313cbf443ffe62e6b1d6268c
94-
GoogleUtilities: 6f681e27050c5e130325e89fa0316dfca826f954
95-
Lobster: fd1c1322233a5de3a9c2aa33124e65d37e04d657
96-
nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
97-
Protobuf: 1eb9700044745f00181c136ef21b8ff3ad5a0fd5
52+
Firebase: 8432d732974498afd5987e9001a05f90f1a3d625
53+
FirebaseABTesting: a32c488eb75089a61eb3d86db061dfb909d765db
54+
FirebaseCore: 68f8a7f50cdae542715d4e86afa37c4067217dcb
55+
FirebaseInstanceID: f20243a1d828e0e9a3798b995174dedc16f1b32a
56+
FirebaseRemoteConfig: 7c64ecec5ca63d7c6b304509c3a6f9a036d403d4
57+
GoogleUtilities: c7a0b08bda3bf808be823ed151f0e28ac6866e71
58+
Lobster: b7c48cf6ff48e80f269715ce80cdc3e087c7b501
59+
Protobuf: 3f617b9a6e73605565086864c9bc26b2bf2dd5a3
9860

9961
PODFILE CHECKSUM: c6efd56fba58da5968399c93e6f38bb7f1692d81
10062

101-
COCOAPODS: 1.6.1
63+
COCOAPODS: 1.7.2

Lobster.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Lobster"
3-
s.version = "2.1"
3+
s.version = "2.2"
44
s.summary = "Type-safe Firebase-RemoteConfig helper library"
55
s.homepage = "https://github.com/sgr-ksmt/Lobster"
66
s.license = 'MIT'
@@ -11,5 +11,5 @@ Pod::Spec.new do |s|
1111
s.source_files = "Sources/**/*"
1212
s.static_framework = true
1313
s.swift_version = '5.0'
14-
s.dependency "Firebase/RemoteConfig", "~> 5.0"
14+
s.dependency "Firebase/RemoteConfig", "~> 6.0"
1515
end

Lobster.xcodeproj/project.pbxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@
253253
hasScannedForEncodings = 0;
254254
knownRegions = (
255255
en,
256+
Base,
256257
);
257258
mainGroup = 163143F51FA8BE8600D25996;
258259
productRefGroup = 163144001FA8BE8600D25996 /* Products */;

Lobster.xcodeproj/xcshareddata/xcschemes/Lobster.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inhibit_all_warnings!
44
use_frameworks!
55

66
target 'Lobster' do
7-
pod 'Firebase/RemoteConfig', '~> 5.0'
7+
pod 'Firebase/RemoteConfig', '~> 6.0'
88
target 'LobsterTests' do
99
inherit! :search_paths
1010
end

Podfile.lock

Lines changed: 33 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,56 @@
11
PODS:
2-
- Firebase/Core (5.18.0):
2+
- Firebase/CoreOnly (6.3.0):
3+
- FirebaseCore (= 6.0.3)
4+
- Firebase/RemoteConfig (6.3.0):
35
- Firebase/CoreOnly
4-
- FirebaseAnalytics (= 5.7.0)
5-
- Firebase/CoreOnly (5.18.0):
6-
- FirebaseCore (= 5.3.1)
7-
- Firebase/RemoteConfig (5.18.0):
8-
- Firebase/Core
9-
- FirebaseRemoteConfig (= 3.1.0)
10-
- FirebaseABTesting (2.0.0):
11-
- FirebaseCore (~> 5.0)
6+
- FirebaseRemoteConfig (~> 4.1.0)
7+
- FirebaseABTesting (3.0.0):
8+
- FirebaseCore (~> 6.0)
129
- Protobuf (~> 3.5)
13-
- FirebaseAnalytics (5.7.0):
14-
- FirebaseCore (~> 5.3)
15-
- FirebaseInstanceID (~> 3.6)
16-
- GoogleAppMeasurement (= 5.7.0)
17-
- GoogleUtilities/AppDelegateSwizzler (~> 5.2)
18-
- GoogleUtilities/MethodSwizzler (~> 5.2)
19-
- GoogleUtilities/Network (~> 5.2)
20-
- "GoogleUtilities/NSData+zlib (~> 5.2)"
21-
- nanopb (~> 0.3)
22-
- FirebaseCore (5.3.1):
23-
- GoogleUtilities/Logger (~> 5.2)
24-
- FirebaseInstanceID (3.7.0):
25-
- FirebaseCore (~> 5.2)
26-
- GoogleUtilities/Environment (~> 5.2)
27-
- GoogleUtilities/UserDefaults (~> 5.2)
28-
- FirebaseRemoteConfig (3.1.0):
29-
- FirebaseABTesting (~> 2.0)
30-
- FirebaseAnalytics (~> 5.3)
31-
- FirebaseCore (~> 5.1)
32-
- FirebaseInstanceID (~> 3.3)
33-
- GoogleUtilities/Environment (~> 5.2)
34-
- "GoogleUtilities/NSData+zlib (~> 5.2)"
10+
- FirebaseCore (6.0.3):
11+
- GoogleUtilities/Environment (~> 6.0)
12+
- GoogleUtilities/Logger (~> 6.0)
13+
- FirebaseInstanceID (4.2.0):
14+
- FirebaseCore (~> 6.0)
15+
- GoogleUtilities/Environment (~> 6.0)
16+
- GoogleUtilities/UserDefaults (~> 6.0)
17+
- FirebaseRemoteConfig (4.1.0):
18+
- FirebaseABTesting (~> 3.0)
19+
- FirebaseCore (~> 6.0)
20+
- FirebaseInstanceID (~> 4.2)
21+
- GoogleUtilities/Environment (~> 6.0)
22+
- "GoogleUtilities/NSData+zlib (~> 6.0)"
3523
- Protobuf (~> 3.5)
36-
- GoogleAppMeasurement (5.7.0):
37-
- GoogleUtilities/AppDelegateSwizzler (~> 5.2)
38-
- GoogleUtilities/MethodSwizzler (~> 5.2)
39-
- GoogleUtilities/Network (~> 5.2)
40-
- "GoogleUtilities/NSData+zlib (~> 5.2)"
41-
- nanopb (~> 0.3)
42-
- GoogleUtilities/AppDelegateSwizzler (5.5.0):
24+
- GoogleUtilities/Environment (6.2.1)
25+
- GoogleUtilities/Logger (6.2.1):
4326
- GoogleUtilities/Environment
27+
- "GoogleUtilities/NSData+zlib (6.2.1)"
28+
- GoogleUtilities/UserDefaults (6.2.1):
4429
- GoogleUtilities/Logger
45-
- GoogleUtilities/Network
46-
- GoogleUtilities/Environment (5.5.0)
47-
- GoogleUtilities/Logger (5.5.0):
48-
- GoogleUtilities/Environment
49-
- GoogleUtilities/MethodSwizzler (5.5.0):
50-
- GoogleUtilities/Logger
51-
- GoogleUtilities/Network (5.5.0):
52-
- GoogleUtilities/Logger
53-
- "GoogleUtilities/NSData+zlib"
54-
- GoogleUtilities/Reachability
55-
- "GoogleUtilities/NSData+zlib (5.5.0)"
56-
- GoogleUtilities/Reachability (5.5.0):
57-
- GoogleUtilities/Logger
58-
- GoogleUtilities/UserDefaults (5.5.0):
59-
- GoogleUtilities/Logger
60-
- nanopb (0.3.901):
61-
- nanopb/decode (= 0.3.901)
62-
- nanopb/encode (= 0.3.901)
63-
- nanopb/decode (0.3.901)
64-
- nanopb/encode (0.3.901)
65-
- Protobuf (3.7.0)
30+
- Protobuf (3.8.0)
6631

6732
DEPENDENCIES:
68-
- Firebase/RemoteConfig (~> 5.0)
33+
- Firebase/RemoteConfig (~> 6.0)
6934

7035
SPEC REPOS:
7136
https://github.com/cocoapods/specs.git:
7237
- Firebase
7338
- FirebaseABTesting
74-
- FirebaseAnalytics
7539
- FirebaseCore
7640
- FirebaseInstanceID
7741
- FirebaseRemoteConfig
78-
- GoogleAppMeasurement
7942
- GoogleUtilities
80-
- nanopb
8143
- Protobuf
8244

8345
SPEC CHECKSUMS:
84-
Firebase: 02f3281965c075426141a0ce1277e9de6649cab9
85-
FirebaseABTesting: 1f50b8d50f5e3469eea54e7463a7b7fe221d1f5e
86-
FirebaseAnalytics: 23851fe602c872130a2c5c55040b302120346cc2
87-
FirebaseCore: 52f851b30e11360f1e67cf04b1edfebf0a47a2d3
88-
FirebaseInstanceID: bd6fc5a258884e206fd5c474ebe4f5b00e21770e
89-
FirebaseRemoteConfig: 7e11c65f0769c09bff6947997c209515058c5318
90-
GoogleAppMeasurement: 6cf307834da065863f9faf4c0de0a936d81dd832
91-
GoogleUtilities: 6481e6318c5fcabaaa8513ef8120f329055d7c10
92-
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
93-
Protobuf: 7a877b7f3e5964e3fce995e2eb323dbc6831bb5a
46+
Firebase: 8432d732974498afd5987e9001a05f90f1a3d625
47+
FirebaseABTesting: a32c488eb75089a61eb3d86db061dfb909d765db
48+
FirebaseCore: 68f8a7f50cdae542715d4e86afa37c4067217dcb
49+
FirebaseInstanceID: f20243a1d828e0e9a3798b995174dedc16f1b32a
50+
FirebaseRemoteConfig: 7c64ecec5ca63d7c6b304509c3a6f9a036d403d4
51+
GoogleUtilities: c7a0b08bda3bf808be823ed151f0e28ac6866e71
52+
Protobuf: 3f617b9a6e73605565086864c9bc26b2bf2dd5a3
9453

95-
PODFILE CHECKSUM: 6434246e86875f87cb87a53d5f214d06ff00ef26
54+
PODFILE CHECKSUM: 36c0843f8e15305700f7260d1eadafe9175ca89d
9655

9756
COCOAPODS: 1.6.1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ $ open Demo.xcworkspace
294294
## Requirements
295295
- iOS 11.0+
296296
- Xcode 10+
297-
- Swift 4.2
297+
- Swift 5.0
298298

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

304304
```ruby
305-
pod 'Lobster', '~> 2.1'
305+
pod 'Lobster', '~> 2.2'
306306
```
307307

308308
and run `pod install`

Sources/Lobster.swift

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ public class Lobster {
1717
/// Returns FIRRemoteConfig instance.
1818
public let remoteConfig = RemoteConfig.remoteConfig()
1919

20+
/// Default expiration duration. (12 hours)
21+
public static let defaultExpirationDuration: TimeInterval = 43_200.0
22+
2023
/// Expiration duration for cache. Default duration is 12 hours
21-
public var fetchExpirationDuration: TimeInterval = 43_200.0
24+
public var fetchExpirationDuration: TimeInterval = Lobster.defaultExpirationDuration
2225

2326
/// The flag whether to do stale check. Default is `true`.
2427
public var useStaleChecker: Bool = true
@@ -41,7 +44,7 @@ public class Lobster {
4144
/// NOTE: It must be false on production.
4245
public var debugMode: Bool = false {
4346
didSet {
44-
remoteConfig.configSettings = RemoteConfigSettings(developerModeEnabled: debugMode)
47+
remoteConfig.configSettings.minimumFetchInterval = debugMode ? 0 : Lobster.defaultExpirationDuration
4548
}
4649
}
4750
public private(set) var fetchStatus: RemoteConfigFetchStatus = .noFetchYet
@@ -57,13 +60,14 @@ public class Lobster {
5760
public func fetch(completion: @escaping (Error?) -> Void = { _ in }) {
5861
let duration = getExpirationDuration()
5962
remoteConfig.fetch(withExpirationDuration: duration) { [unowned self] (status, error) in
60-
if error == nil {
61-
RemoteConfig.remoteConfig().activateFetched()
63+
var fetchError: Error? = error
64+
RemoteConfig.remoteConfig().activate { (error) in
65+
fetchError = error ?? fetchError
66+
self.fetchStatus = status
67+
self.isStaled = false
68+
completion(fetchError)
69+
NotificationCenter.default.post(name: Lobster.didFetchConfig, object: error)
6270
}
63-
self.fetchStatus = status
64-
self.isStaled = false
65-
completion(error)
66-
NotificationCenter.default.post(name: Lobster.didFetchConfig, object: error)
6771
}
6872
}
6973

0 commit comments

Comments
 (0)