Skip to content

Commit 6e01068

Browse files
committed
Review
1 parent 354f90b commit 6e01068

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

FirebaseRemoteConfig/SwiftNew/ConfigExperiment.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@ import Foundation
1818
// TODO(ncooke3): Once everything is ported, the `@objc` and `public` access
1919
// can be removed.
2020

21-
@objc(RCNConfigExperimentFake) public class ConfigExperimentFake: ConfigExperiment {
22-
override public func updateExperiments(handler: (((any Error)?) -> Void)? = nil) {
23-
handler?(nil)
24-
}
25-
}
26-
2721
/// Handles experiment information update and persistence.
28-
@objc(RCNConfigExperiment) public class ConfigExperiment: NSObject {
22+
@objc(RCNConfigExperiment) open class ConfigExperiment: NSObject {
2923
private static let experimentMetadataKeyLastStartTime = "last_experiment_start_time"
3024
private static let serviceOrigin = "frc"
3125

@@ -128,7 +122,7 @@ import Foundation
128122
}
129123

130124
/// Update experiments to Firebase Analytics when `activateWithCompletion:` happens.
131-
@objc public func updateExperiments(handler: (((any Error)?) -> Void)? = nil) {
125+
@objc open func updateExperiments(handler: (((any Error)?) -> Void)? = nil) {
132126
let lifecycleEvent = LifecycleEvents()
133127

134128
// Get the last experiment start time prior to the latest payload.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import FirebaseRemoteConfig
16+
17+
@objc(RCNConfigExperimentFake) public class ConfigExperimentFake: ConfigExperiment {
18+
override public func updateExperiments(handler: (((any Error)?) -> Void)? = nil) {
19+
handler?(nil)
20+
}
21+
}

FirebaseRemoteConfig/Tests/Unit/RCNRemoteConfigTest.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
#import <OCMock/OCMock.h>
1919
#import <XCTest/XCTest.h>
2020

21+
// Import Swift testing fakes.
22+
#import "FirebaseRemoteConfig_Unit_unit-Swift.h"
23+
2124
@import FirebaseRemoteConfig;
2225
@import FirebaseCore;
2326
@import FirebaseABTesting;

0 commit comments

Comments
 (0)