-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integrate statsig #215
integrate statsig #215
Conversation
45e5b98
to
6dc0507
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruixhuang lmk if you don't think this should be removed. But it doesn't seem to have any effect based on current feature flags
if parser.asBoolean(FeatureService.shared?.flag(feature: "webview_popup"))?.boolValue ?? false { | ||
configuration.preferences.javaScriptEnabled = true | ||
configuration.preferences.javaScriptCanOpenWindowsAutomatically = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed since I haven't seen this feature flag, ever
switch self { | ||
case .enable_app_rating: | ||
return Self.obj.parser.asBoolean(FeatureService.shared?.flag(feature: rawValue))?.boolValue ?? true | ||
case .push_notification, .force_mainnet: | ||
return Self.obj.parser.asBoolean(FeatureService.shared?.flag(feature: rawValue))?.boolValue ?? false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preferring more statically typed version of this
@@ -17,7 +17,7 @@ open class JsonCredentialsProvider: NSObject { | |||
|
|||
private var entity: DictionaryEntity? | |||
|
|||
public func key(for lookupKey: String) -> String? { | |||
public func credential(for lookupKey: String) -> String? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed to credential
since key
is confusing to me. The credential is not always an api key
private let newValuesSubject = PassthroughSubject<Void, Never>() | ||
public var newValuesAvailablePublisher: AnyPublisher<Void, Never> { | ||
newValuesSubject.eraseToAnyPublisher() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note this publisher which is made available in the FeatureFlags protocol
public func value(feature: String) -> String? { | ||
// not yet implemented for Statsig feature flags since it is not yet needed | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statsig supports non-bool feature flags, but they require more configuration. I figured we can tackle that when we get there
|
||
public protocol FeatureFlagsProtocol { | ||
var featureFlags: [String: Any]? { get } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The statsig SDK does not expose a list of feature flags, so this pattern had to change
func value(feature: String) -> String? | ||
func isOn(feature: String) -> Bool? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer this more statically typed
public class FeatureFlaggedParser: ConditionalParser { | ||
@objc override public func conditioned(_ data: Any?) -> Any? { | ||
var conditions = self.conditions ?? [String: String]() | ||
if let features = FeatureService.shared?.featureFlags { | ||
for arg0 in features { | ||
let (key, value) = arg0 | ||
conditions[key] = parser.asString(value) | ||
} | ||
} | ||
self.conditions = conditions | ||
return super.conditioned(data) | ||
} | ||
} | ||
|
||
extension Parser { | ||
@objc public static var featureFlagged: Parser = { | ||
FeatureFlaggedParser() | ||
}() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ruixhuang this is what was removed, but I could not see any use case for it. Let me know if I should add back
3601c7e
to
b0b8ea8
Compare
* integrate statsig * comment * remove FirebaseRemoteConfig * add skip to features.json * change inputs to on/off * integrate statsig with featureflag protocol * comment * change assertion failure to log * delete file * deleted code * comment * Update PodFile * bump abacus * fix pods? * remove unnecessary import --------- Co-authored-by: Mike <[email protected]>
* integrate statsig * comment * remove FirebaseRemoteConfig * add skip to features.json * change inputs to on/off * integrate statsig with featureflag protocol * comment * change assertion failure to log * delete file * deleted code * comment * Update PodFile * bump abacus * fix pods? * remove unnecessary import --------- Co-authored-by: Mike <[email protected]>
* integrate statsig * comment * remove FirebaseRemoteConfig * add skip to features.json * change inputs to on/off * integrate statsig with featureflag protocol * comment * change assertion failure to log * delete file * deleted code * comment * Update PodFile * bump abacus * fix pods? * remove unnecessary import --------- Co-authored-by: Mike <[email protected]>
Description / Intuition
key
tocredential
Type of Change