Closed mcmurrym closed 4 months ago
@mcmurrym I am badly struck in extracting the values. Please help me with this. I am using LaunchDarkly 6.0 and getting flag value as a dictionary. I am facing problem in reading the values from flag. This is how I am getting flag value from server -
let arrayValue = LDClient.get()!.jsonVariationDetail(forKey: forFlag, defaultValue: ["enabled": false])
And, I get this response -
My problem is how do I read the values from arrayValue.value ? I need to make certain changes depending on the values from dictionary. cc: @@louis-launchdarkly
Given this is a solution suggestion for the concern in #274, we will keep the discussion there for now.
I just ran into this issue as well, and it's a big bummer that LD does not make these values easily codable. It would be great if they were just parsed out as a regular set of struct as needed @louis-launchdarkly
We just released v9.4.0 which adds two new methods variation<T>
and variationDetail<T>
! Both of these methods accept a type that must be Decodable and implement our LDValueConvertible protocol (required for now to deal with some internal plumbing).
Add times it would be nice if we could just get back a representation of the value that is stored for a variation. This would help with
Data
orhttps://github.com/launchdarkly/ios-client-sdk/issues/274
.Something like...
I would be more than happy to help create the solution, but because
LDValue
goes as deep as it does, it would take some non-insignificant changes.