Skip to content

Commit

Permalink
Add launchable markets
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang committed Feb 1, 2025
1 parent d039362 commit 9a88c14
Show file tree
Hide file tree
Showing 20 changed files with 252 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
import Utilities

@objc public final class LocalFeatureFlagsCacheInteractor: LocalEntityCacheInteractor, SingletonProtocol, FeatureFlagsProtocol {
public func value<T>(feature: String, defaultValue: T) -> T {
defaultValue
}

public static var shared: LocalFeatureFlagsCacheInteractor = {
LocalFeatureFlagsCacheInteractor(key: "features", default: "features_default.json")
}()
Expand Down
11 changes: 11 additions & 0 deletions StatsigInjections/StatsigInjections/StatsigInjections.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ public final class StatsigFeatureFlagsProvider: NSObject, FeatureFlagsProtocol {
return nil
}

public func value<T>(feature: String, defaultValue: T) -> T {
let store = Statsig.getParameterStore("v4_params")
if let defaultValue = defaultValue as? StatsigDynamicConfigValue {
let result = store.getValue(forKey: feature, defaultValue: defaultValue)
if let result = result as? T {
return result
}
}
return defaultValue
}

public func customized() -> Bool {
return false
}
Expand Down
8 changes: 8 additions & 0 deletions Utilities/Utilities/_Store/FeatureFlagsStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ public class FeatureFlagsStore: UserDefaultsStore, FeatureFlagsProtocol {
}
return nil
}

public func value<T>(feature: String, defaultValue: T) -> T {
let value = value(feature: feature)
if let value = value as? T {
return value
}
return defaultValue
}

public func customized() -> Bool {
#if DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ public class CompositeFeatureFlagsProvider: NSObject & FeatureFlagsProtocol {
}
}
}


public func value<T>(feature: String, defaultValue: T) -> T {
remote?.value(feature: feature, defaultValue: defaultValue) ?? defaultValue
}

public func isOn(feature: String) -> Bool? {
switch Installation.source {
case .appStore, .jailBroken:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public protocol FeatureFlagsProtocol {
func refresh(completion: @escaping () -> Void)
func activate(completion: @escaping () -> Void)
func value(feature: String) -> String?
func value<T>(feature: String, defaultValue: T) -> T
func isOn(feature: String) -> Bool?

func customized() -> Bool
}

Expand Down
1 change: 1 addition & 0 deletions dydx/PodFile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ end

def abacus_pods
#pod 'abacus', :path => '~/v4-abacus'
cccccbrgcggblcucvihifbbidlutfrcvrffnvvvhgfkt
pod 'Abacus', :podspec => '../podspecs/Abacus.podspec'
end

Expand Down
8 changes: 4 additions & 4 deletions dydx/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- Abacus (1.13.49)
- AmplitudeSwift (1.11.3):
- Abacus (1.13.50)
- AmplitudeSwift (1.11.4):
- AnalyticsConnector (~> 1.3.0)
- AnalyticsConnector (1.3.1)
- AppsFlyerFramework (6.16.0):
Expand Down Expand Up @@ -379,8 +379,8 @@ CHECKOUT OPTIONS:
:git: https://github.com/dydxprotocol/Charts.git

SPEC CHECKSUMS:
Abacus: a0482c9f6c31aa394169551978ee8d374a02b9ad
AmplitudeSwift: 2e4c83a17a83262e32cd5b05ce11737a26ec3244
Abacus: f5b4140686f5d9556f275d811fea274d6c253c04
AmplitudeSwift: 1e64ee50853f0bab85d3f450770055585d5747ff
AnalyticsConnector: 3def11199b4ddcad7202c778bde982ec5da0ebb3
AppsFlyerFramework: 4e88540b96c0bd57c5cfffbac63e392387e44b93
Atributika: ecedf5259e4aa3c6278d840b6c18d60c1a8b6ca0
Expand Down
2 changes: 1 addition & 1 deletion dydx/Pods/AmplitudeSwift/Sources/Amplitude/Constants.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dydx/Pods/Local Podspecs/abacus.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dydx/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9a88c14

Please sign in to comment.