Skip to content

Conversation

@ncooke3
Copy link
Member

@ncooke3 ncooke3 commented Mar 4, 2025

Fix #14368

Relevant: #9084 (comment)

I did not update the following APIs because I wasn't able to get a test case working (See be0616a). I think it's reasonable to limit the scope of exposing the FirebaseData*coders in the public API since it needs some re-thinking).

  • func decoded<Value: Decodable>(asType: Value.Type = Value.self) throws -> Value {
    if asType == Date.self {
    throw RemoteConfigValueCodableError
    .unsupportedType("Date type is not currently supported for " +
    " Remote Config Value decoding. Please file a feature request")
    }
    return try FirebaseDataDecoder()
    .decode(Value.self, from: FirebaseRemoteConfigValueDecoderHelper(value: self))
    }
    }
  • /// Return a typed RemoteConfigValue for a key.
    /// - Parameter key: A Remote Config key.
    /// - Returns: A typed RemoteConfigValue.
    subscript<T: Decodable>(decodedValue key: String) -> T? {
    return try? configValue(forKey: key).decoded()
    }
@ncooke3 ncooke3 marked this pull request as ready for review March 5, 2025 14:16
Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a short API review document.

@ncooke3 ncooke3 merged commit 8ee1e96 into main Mar 6, 2025
47 checks passed
@ncooke3 ncooke3 deleted the nc/14368 branch March 6, 2025 23:31
ncooke3 added a commit that referenced this pull request Mar 11, 2025
@firebase firebase locked and limited conversation to collaborators Apr 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

3 participants