Skip to content

Commit

Permalink
[Config] Port 'ConfigExperiment' to Swift (#14179)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncooke3 authored and paulb777 committed Dec 11, 2024
1 parent 80286fe commit 4714175
Show file tree
Hide file tree
Showing 10 changed files with 209 additions and 259 deletions.
2 changes: 2 additions & 0 deletions FirebaseABTesting/Sources/ABTExperimentPayload.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#import "FirebaseABTesting/Sources/Private/ABTExperimentPayload.h"

#import "FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRExperimentController.h"

static NSString *const kExperimentPayloadKeyExperimentID = @"experimentId";
static NSString *const kExperimentPayloadKeyVariantID = @"variantId";

Expand Down
11 changes: 2 additions & 9 deletions FirebaseABTesting/Sources/Private/ABTExperimentPayload.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
#import "FirebaseABTesting/Sources/Public/FirebaseABTesting/FIRExperimentController.h"

/// Policy for handling the case where there's an overflow of experiments for an installation
/// instance.
typedef NS_ENUM(int32_t, ABTExperimentPayloadExperimentOverflowPolicy) {
ABTExperimentPayloadExperimentOverflowPolicyUnrecognizedValue = 999,
ABTExperimentPayloadExperimentOverflowPolicyUnspecified = 0,
ABTExperimentPayloadExperimentOverflowPolicyDiscardOldest = 1,
ABTExperimentPayloadExperimentOverflowPolicyIgnoreNewest = 2,
};
NS_ASSUME_NONNULL_BEGIN

@interface ABTExperimentLite : NSObject
@property(nonatomic, readonly, copy) NSString *experimentId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@

#import <Foundation/Foundation.h>

#import "FIRLifecycleEvents.h"

@class ABTExperimentPayload;

// Forward declaration to avoid importing into the module header
typedef NS_ENUM(int32_t, ABTExperimentPayloadExperimentOverflowPolicy);
/// Policy for handling the case where there's an overflow of experiments for an installation
/// instance.
typedef NS_ENUM(int32_t, ABTExperimentPayloadExperimentOverflowPolicy) {
ABTExperimentPayloadExperimentOverflowPolicyUnrecognizedValue = 999,
ABTExperimentPayloadExperimentOverflowPolicyUnspecified = 0,
ABTExperimentPayloadExperimentOverflowPolicyDiscardOldest = 1,
ABTExperimentPayloadExperimentOverflowPolicyIgnoreNewest = 2,
};

NS_ASSUME_NONNULL_BEGIN

@class FIRLifecycleEvents;

/// The default experiment overflow policy, that is to discard the experiment with the oldest start
/// time when users start the experiment on the web console.
extern const ABTExperimentPayloadExperimentOverflowPolicy FIRDefaultExperimentOverflowPolicy;
Expand Down
1 change: 0 additions & 1 deletion FirebaseRemoteConfig/Sources/FIRRemoteConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#import "FirebaseRemoteConfig/Sources/Private/RCNConfigFetch.h"
#import "FirebaseRemoteConfig/Sources/Private/RCNConfigSettings.h"
#import "FirebaseRemoteConfig/Sources/RCNConfigConstants.h"
#import "FirebaseRemoteConfig/Sources/RCNConfigExperiment.h"
#import "FirebaseRemoteConfig/Sources/RCNConfigRealtime.h"
#import "FirebaseRemoteConfig/Sources/RCNConfigValue_Internal.h"
#import "FirebaseRemoteConfig/Sources/RCNPersonalization.h"
Expand Down
38 changes: 0 additions & 38 deletions FirebaseRemoteConfig/Sources/RCNConfigExperiment.h

This file was deleted.

202 changes: 0 additions & 202 deletions FirebaseRemoteConfig/Sources/RCNConfigExperiment.m

This file was deleted.

1 change: 0 additions & 1 deletion FirebaseRemoteConfig/Sources/RCNConfigFetch.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#import "FirebaseInstallations/Source/Library/Private/FirebaseInstallationsInternal.h"
#import "FirebaseRemoteConfig/Sources/Private/RCNConfigSettings.h"
#import "FirebaseRemoteConfig/Sources/RCNConfigConstants.h"
#import "FirebaseRemoteConfig/Sources/RCNConfigExperiment.h"

#import "FirebaseRemoteConfig/FirebaseRemoteConfig-Swift.h"

Expand Down
Loading

0 comments on commit 4714175

Please sign in to comment.